From 4d662427a872aa25ffee0ea3a357dd73794e7bf1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 16 Nov 2023 12:01:19 -0500 Subject: [PATCH] Update main.c conditional test --- main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index b09e0297..cfba586c 100644 --- a/main.c +++ b/main.c @@ -814,11 +814,11 @@ int main(int argc, char * argv[]) { fprintf(stderr, "INFO: Battery voltage: %5.2f V Threshold %5.2f V Current: %6.1f mA Threshold: %6.1f mA\n", batteryVoltage, voltageThreshold, batteryCurrent, currentThreshold); #endif // if ((batteryVoltage > 1.0) && (batteryVoltage < batteryThreshold)) // no battery INA219 will give 0V, no battery plugged into INA219 will read < 1V -printf("battery_saver_check() : %d current: %d\n", battery_saver_check(), batteryCurrent); -if ((battery_saver_check() == 1) && (batteryCurrent < 0)) - printf("Conditional true!\n"); +printf("\n\nbattery_saver_check() : %d current: %f\n", battery_saver_check(), batteryCurrent); +if ((battery_saver_check() == 1) && (batteryCurrent < 0.0)) + printf("\nConditional true!\n"); else - printf("Conditional false!\n"); + printf("\nConditional false!\n"); /**/ #ifndef HAB if ((batteryCurrent > currentThreshold) && (batteryVoltage < (voltageThreshold + 0.15)) && !sim_mode)