mirror of https://github.com/arendst/Tasmota.git
parent
164db4e12b
commit
52eeef95f0
|
@ -6,6 +6,7 @@
|
|||
* Fix possible strncat buffer overflows
|
||||
* Fix MqttRetry values above 255 seconds (#4424)
|
||||
* Increase webui refresh time delay for Save Settings and local OTA Upload (#4423)
|
||||
* Add CPU average load to state message (#4431)
|
||||
*
|
||||
* 6.3.0.11 20181120
|
||||
* Add delays removed in 6.3.0.9 (#4233)
|
||||
|
|
|
@ -2583,14 +2583,13 @@ void GpioInit(void)
|
|||
|
||||
XdrvCall(FUNC_PRE_INIT);
|
||||
}
|
||||
|
||||
void update_loop_load_avg(uint32_t loop_activity)
|
||||
|
||||
void UpdateLoopLoadAvg(uint32_t loop_activity)
|
||||
{
|
||||
uint32_t loops_per_second = 1000 / (uint32_t)Settings.param[P_LOOP_SLEEP_DELAY]; // We need to keep track of this many loops per second
|
||||
uint32_t loops_per_second = 1000 / (uint32_t)Settings.param[P_LOOP_SLEEP_DELAY]; // We need to keep track of this many loops per second
|
||||
uint32_t this_cycle_ratio = 100 * loop_activity / (uint32_t)Settings.param[P_LOOP_SLEEP_DELAY];
|
||||
uint32_t new_load_avg = loop_load_avg-(loop_load_avg/loops_per_second); // Take away one loop average
|
||||
new_load_avg = new_load_avg + this_cycle_ratio;
|
||||
loop_load_avg = new_load_avg;
|
||||
uint32_t new_load_avg = loop_load_avg - (loop_load_avg / loops_per_second); // Take away one loop average
|
||||
loop_load_avg = new_load_avg + this_cycle_ratio;;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
@ -2799,8 +2798,8 @@ void loop(void)
|
|||
}
|
||||
}
|
||||
if (my_activity < (uint32_t)Settings.param[P_LOOP_SLEEP_DELAY]) {
|
||||
update_loop_load_avg(my_activity);
|
||||
UpdateLoopLoadAvg(my_activity);
|
||||
} else {
|
||||
update_loop_load_avg((uint32_t)Settings.param[P_LOOP_SLEEP_DELAY]); // Assume 100% loop cycle ratio
|
||||
UpdateLoopLoadAvg((uint32_t)Settings.param[P_LOOP_SLEEP_DELAY]); // Assume 100% loop cycle ratio
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue