Unified low battery indication of LED/RGB matrix and individual LED; Fixed bluetooth name may not be set correctly after factory reset

This commit is contained in:
lokher 2024-11-09 15:45:12 +08:00
commit 27a218a3d1
11 changed files with 98 additions and 147 deletions

View file

@ -167,12 +167,7 @@ void battery_check_empty(void) {
if (voltage < EMPTY_VOLTAGE_VALUE) {
if (bat_empty <= BATTERY_EMPTY_COUNT) {
if (++bat_empty > BATTERY_EMPTY_COUNT) {
#ifdef BAT_LOW_LED_PIN
indicator_battery_low_enable(true);
#endif
#if defined(LOW_BAT_IND_INDEX)
indicator_battery_low_backlit_enable(true);
#endif
power_on_sample = VOLTAGE_POWER_ON_MEASURE_COUNT;
}
}
@ -229,11 +224,6 @@ void battery_task(void) {
if ((bat_empty || critical_low) && usb_power_connected()) {
bat_empty = false;
critical_low = false;
#ifdef BAT_LOW_LED_PIN
indicator_battery_low_enable(false);
#endif
#if defined(LOW_BAT_IND_INDEX)
indicator_battery_low_backlit_enable(false);
#endif
}
}