From be890e20ae89ccf2362e9301cb3f26afe47e3b3e Mon Sep 17 00:00:00 2001 From: Lazar Obradovic Date: Thu, 8 Mar 2018 21:13:32 +0100 Subject: [PATCH] reduced scope of 2 vars. --- code/espurna/system.ino | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/espurna/system.ino b/code/espurna/system.ino index 82c8b854..44c4e428 100644 --- a/code/espurna/system.ino +++ b/code/espurna/system.ino @@ -85,12 +85,13 @@ void systemLoop() { // Increase temporary loop counter static unsigned long load_counter_temp = 0; - static unsigned long load_counter = 0; - static unsigned long load_counter_max = 1; static unsigned long last_loadcheck = 0; load_counter_temp++; if (millis() - last_loadcheck > LOADAVG_INTERVAL) { + static unsigned long load_counter = 0; + static unsigned long load_counter_max = 1; + load_counter = load_counter_temp; load_counter_temp = 0; if (load_counter > load_counter_max) {