From 0b14a95082a4c69e21b9a3fbe7e2a936e44c1a79 Mon Sep 17 00:00:00 2001 From: andrethomas Date: Sun, 25 Nov 2018 17:52:07 +0200 Subject: [PATCH] Remove assumption of 100% to report correctly Remove the assumption of 100% loop duty cycle as we want an accurate loop load average and not a percentage as such - so if it overshoots the value stored for setoption36 this should be known by looking at the load average and not be distorted by reducing it to 100 basis points on the assumption that my_acitivity took as long as setoption36. --- sonoff/sonoff.ino | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 9e32caf0b..43f5d99ad 100755 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -2799,9 +2799,5 @@ void loop(void) delay(my_activity /2); // If wifi down and my_activity > setoption36 then force loop delay to 1/3 of my_activity period } } - if (my_activity < (uint32_t)Settings.param[P_LOOP_SLEEP_DELAY]) { - UpdateLoopLoadAvg(my_activity); - } else { - UpdateLoopLoadAvg((uint32_t)Settings.param[P_LOOP_SLEEP_DELAY]); // Assume 100% loop cycle ratio - } + UpdateLoopLoadAvg(my_activity); }