From 303885fde55a71d1e07add3f7e0bebfae9d77066 Mon Sep 17 00:00:00 2001 From: Ollo Date: Wed, 9 Dec 2020 21:39:48 +0100 Subject: [PATCH] Fixed wakeup due static code analysis --- esp32/src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index ad70880..f7bfe09 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -441,20 +441,20 @@ bool readSensors() delay(50); } - if (abs(temp1.getAverage() - rtcLastTemp1 > TEMPERATURE_DELTA_TRIGGER_IN_C)) { + if (abs(temp1.getAverage() - rtcLastTemp1) > TEMPERATURE_DELTA_TRIGGER_IN_C) { leaveMode1 = true; wakeUpReason = WAKEUP_REASON_TEMP1_CHANGE; } - if (abs(temp2.getAverage() - rtcLastTemp2 > TEMPERATURE_DELTA_TRIGGER_IN_C)) { + if (abs(temp2.getAverage() - rtcLastTemp2) > TEMPERATURE_DELTA_TRIGGER_IN_C) { wakeUpReason = WAKEUP_REASON_TEMP2_CHANGE; leaveMode1 = true; } - if (abs(getBatteryVoltage() - rtcLastBatteryVoltage > LIPO_DELTA_VOLT_ADC)) { + if (abs(getBatteryVoltage() - rtcLastBatteryVoltage) > LIPO_DELTA_VOLT_ADC) { wakeUpReason = WAKEUP_REASON_BATTERY_CHANGE; leaveMode1 = true; } - if (abs(getSolarVoltage() - rtcLastSolarVoltage > SOLAR_DELTA_VOLT_ADC)) { + if (abs(getSolarVoltage() - rtcLastSolarVoltage) > SOLAR_DELTA_VOLT_ADC) { wakeUpReason = WAKEUP_REASON_SOLAR_CHANGE; leaveMode1 = true; }