Skip to content

Commit 0968f4c

Browse files
committed
Cause Artemis to reset if battery is low and NoPowerLossProtection is enabled
1 parent b025f30 commit 0968f4c

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed
-40 Bytes
Binary file not shown.

Firmware/OpenLog_Artemis/lowerPower.ino

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,20 @@ void checkBattery(void)
3030

3131
delay(sdPowerDownDelay); // Give the SD card time to finish writing ***** THIS IS CRITICAL *****
3232

33+
#ifdef noPowerLossProtection
34+
SerialPrintln(F("*** LOW BATTERY VOLTAGE DETECTED! RESETTING... ***"));
35+
SerialPrintln(F("*** PLEASE CHANGE THE POWER SOURCE TO CONTINUE ***"));
36+
37+
SerialFlush(); //Finish any prints
38+
39+
resetArtemis(); // Reset the Artemis so we don't get stuck in a low voltage infinite loop
40+
#else
3341
SerialPrintln(F("*** LOW BATTERY VOLTAGE DETECTED! GOING INTO POWERDOWN ***"));
3442
SerialPrintln(F("*** PLEASE CHANGE THE POWER SOURCE AND RESET THE OLA TO CONTINUE ***"));
3543

3644
SerialFlush(); //Finish any prints
3745

38-
#ifdef noPowerLossProtection
39-
// Leave the WDT running so it will reset the Artemis is required
40-
// Don't go into deep sleep. Just keep running. Draining the battery...
41-
// User can prevent this by disabling settings.enableLowBatteryDetection
42-
while (1)
43-
;
44-
#else
45-
powerDownOLA(); // power down and wait for reset
46+
powerDownOLA(); // Power down and wait for reset
4647
#endif
4748
}
4849
}

0 commit comments

Comments
 (0)