mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-08 06:28:51 +00:00
Minor adjustment of blink codes and 'unstick' the M2 button. (#6521)
This commit is contained in:
parent
cfc2a96a45
commit
c94dd1e331
@ -349,8 +349,12 @@ void ButtonThread::attachButtonInterrupts()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BUTTON_PIN_ALT
|
#ifdef BUTTON_PIN_ALT
|
||||||
|
#ifdef ELECROW_ThinkNode_M2
|
||||||
|
wakeOnIrq(BUTTON_PIN_ALT, RISING);
|
||||||
|
#else
|
||||||
wakeOnIrq(BUTTON_PIN_ALT, FALLING);
|
wakeOnIrq(BUTTON_PIN_ALT, FALLING);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BUTTON_PIN_TOUCH
|
#ifdef BUTTON_PIN_TOUCH
|
||||||
wakeOnIrq(BUTTON_PIN_TOUCH, FALLING);
|
wakeOnIrq(BUTTON_PIN_TOUCH, FALLING);
|
||||||
|
@ -248,8 +248,9 @@ static int32_t elecrowLedBlinker()
|
|||||||
return 1000;
|
return 1000;
|
||||||
|
|
||||||
static bool ledOn;
|
static bool ledOn;
|
||||||
// when fully charged, remain on!
|
// remain on when fully charged or discharging above 10%
|
||||||
if (powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() >= 100) {
|
if ((powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() >= 100) ||
|
||||||
|
(!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() >= 10)) {
|
||||||
ledOn = true;
|
ledOn = true;
|
||||||
} else {
|
} else {
|
||||||
ledOn ^= 1;
|
ledOn ^= 1;
|
||||||
@ -259,8 +260,8 @@ static int32_t elecrowLedBlinker()
|
|||||||
if (powerStatus->getIsCharging()) {
|
if (powerStatus->getIsCharging()) {
|
||||||
return 500;
|
return 500;
|
||||||
}
|
}
|
||||||
// When almost empty, blink rapidly
|
// Blink rapidly when almost empty or if battery is not connected
|
||||||
if (!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() < 10) {
|
if ((!powerStatus->getIsCharging() && powerStatus->getBatteryChargePercent() < 10) || !powerStatus->getHasBattery()) {
|
||||||
return 250;
|
return 250;
|
||||||
}
|
}
|
||||||
#if HAS_BUTTON
|
#if HAS_BUTTON
|
||||||
|
Loading…
Reference in New Issue
Block a user