Minor adjustment of blink codes and 'unstick' the M2 button. (#6521)

This commit is contained in:
Thomas Göttgens 2025-04-08 17:46:39 +02:00 committed by GitHub
parent cfc2a96a45
commit c94dd1e331
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View File

@ -349,8 +349,12 @@ void ButtonThread::attachButtonInterrupts()
#endif
#ifdef BUTTON_PIN_ALT
#ifdef ELECROW_ThinkNode_M2
wakeOnIrq(BUTTON_PIN_ALT, RISING);
#else
wakeOnIrq(BUTTON_PIN_ALT, FALLING);
#endif
#endif
#ifdef BUTTON_PIN_TOUCH
wakeOnIrq(BUTTON_PIN_TOUCH, FALLING);

View File

@ -248,8 +248,9 @@ static int32_t elecrowLedBlinker()
return 1000;
static bool ledOn;
// when fully charged, remain on!
if (powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() >= 100) {
// remain on when fully charged or discharging above 10%
if ((powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() >= 100) ||
(!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() >= 10)) {
ledOn = true;
} else {
ledOn ^= 1;
@ -259,8 +260,8 @@ static int32_t elecrowLedBlinker()
if (powerStatus->getIsCharging()) {
return 500;
}
// When almost empty, blink rapidly
if (!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() < 10) {
// Blink rapidly when almost empty or if battery is not connected
if ((!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() < 10) || !powerStatus->getHasBattery()) {
return 250;
}
#if HAS_BUTTON