battery management

This commit is contained in:
2022-01-04 17:02:02 +01:00
parent 14b25a9459
commit d27b693db1
7 changed files with 33 additions and 29 deletions

View File

@@ -130,7 +130,7 @@ void handlePowerState(void)
if (getLowBatt())
{
log_w("on: Lowbat");
// powerstate = lowBatt;
powerstate = lowBatt;
SetLedColor(CRGB::Red, true);
break;
}
@@ -184,10 +184,14 @@ void handlePowerState(void)
case lowBatt:
{
// add delay
powerstate = off;
for (int i = 0; i < 6; i++)
//powerstate = off;
if(!getLowBatt())
{
powerstate = on;
SetLedColor(CRGB::Green);
}
else
{
log_w("lowbatt");
SetLedColor(CRGB::Red, true);
}
}