Skip to content

Commit 321371a

Browse files
committed
Don't powerDown() Torch if <5% power
1 parent 6609894 commit 321371a

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Firmware/RTK_Everywhere/Begin.ino

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -893,14 +893,21 @@ void beginFuelGauge()
893893
// Check to see if we are dangerously low
894894
if ((batteryLevelPercent < 5) && (isCharging() == false)) // 5% and not charging
895895
{
896-
systemPrintln("Battery too low. Please charge. Shutting down...");
896+
// Currently only the Torch uses the BQ40Z50 and it does not have software shutdown
897+
// So throw a warning, but don't do anything else.
898+
systemPrintln("Battery too low. Please charge.");
897899

898-
if (online.display == true)
899-
displayMessage("Charge Battery", 0);
900+
// If future platforms use the BQ40Z50 and have software shutdown, allow it
901+
// but avoid blocking Torch with the infinite loop of powerDown().
900902

901-
delay(2000);
903+
// systemPrintln("Battery too low. Please charge. Shutting down...");
902904

903-
powerDown(false); // Don't display 'Shutting Down'
905+
// if (online.display == true)
906+
// displayMessage("Charge Battery", 0);
907+
908+
// delay(2000);
909+
910+
// powerDown(false); // Don't display 'Shutting Down'
904911
}
905912
}
906913
#endif // COMPILE_BQ40Z50

0 commit comments

Comments
 (0)