disable battery level LEDs

This commit is contained in:
2025-09-06 11:21:38 +02:00
parent 10609e169f
commit 16913b5c7f
2 changed files with 17 additions and 7 deletions

14
main.c
View File

@ -31,6 +31,7 @@ volatile bool bBtnPressed = false;
void blinkLed(bool resetCounters);
static inline void leds_off(void);
static inline void leds_on(void);
static void battery_level_indicator(void);
static void handleSwitch(void);
/**
@ -39,7 +40,7 @@ static void handleSwitch(void);
int main(void)
{
// Configure LED pins as outputs
VPORTA.DIR = (PA1_SET_MASK | PA2_SET_MASK | PA3_SET_MASK | /*PA6_SET_MASK |*/ PA7_SET_MASK);
VPORTA.DIR = (PA1_SET_MASK | PA2_SET_MASK | PA3_SET_MASK | PA6_SET_MASK | PA7_SET_MASK);
// Configure PA0 as input with pull-up
VPORTA.DIR &= ~BUTTON_PIN_MASK; // Input
@ -47,7 +48,7 @@ int main(void)
// Ensure all LEDs off at startup
leds_off();
VPORTA.OUT &= (uint8_t)~PA7_SET_MASK;
battery_level_indicator(); // TODO: Implement
bool bLedEnabledOld = bLedEnabled;
@ -107,6 +108,15 @@ static inline void leds_on(void)
VPORTA.OUT |= (PA1_SET_MASK | PA2_SET_MASK | PA3_SET_MASK);
}
/**
* @brief Battery monitoring
*/
static void battery_level_indicator(void)
{
// TODO: Implement
VPORTA.OUT |= (PA6_SET_MASK | PA7_SET_MASK); // green + red OFF
}
/**
* @brief Handle momentary switch input on PA0
*