From b8d328ec1d974df678c59d8a7f10710388b0d23a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 18 Nov 2023 14:47:28 -0500 Subject: [PATCH] Update main.c add back in auto shutdown --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 1e705040..aa93d5a8 100644 --- a/main.c +++ b/main.c @@ -836,7 +836,8 @@ fprintf(stderr, "\n\nbattery_saver_mode : %d current: %f\n", battery_saver_mode, fprintf(stderr,"Battery is being charged - switch battery saver off\n"); if (battery_saver_mode == ON) battery_saver(OFF); - } else if ((batteryCurrent > currentThreshold) && (batteryVoltage < voltageThreshold) && !sim_mode) // currentThreshold ensures that this won't happen when running on DC power. + } + if ((batteryCurrent > currentThreshold) && (batteryVoltage < voltageThreshold) && !sim_mode) // currentThreshold ensures that this won't happen when running on DC power. { fprintf(stderr, "Battery voltage too low: %f V - shutting down!\n", batteryVoltage); digitalWrite(txLed, txLedOff);