diff --git a/src/main_arduino.cpp b/src/main_arduino.cpp index 441d66d5..b6dfdc63 100644 --- a/src/main_arduino.cpp +++ b/src/main_arduino.cpp @@ -29,7 +29,7 @@ uint8_t mainLoopCounter = 0; unsigned long mainLastLoopTime = 0; #ifdef HASP_USE_STAT_COUNTER -uint8_t statLoopCounter = 0; // measures the average looptime +uint16_t statLoopCounter = 0; // measures the average looptime #endif void setup() diff --git a/src/main_sdl2.cpp b/src/main_sdl2.cpp index 1d3456ae..6a7e5501 100644 --- a/src/main_sdl2.cpp +++ b/src/main_sdl2.cpp @@ -46,6 +46,10 @@ bool isRunning = 1; uint8_t mainLoopCounter = 0; unsigned long mainLastLoopTime = 0; +#ifdef HASP_USE_STAT_COUNTER +uint16_t statLoopCounter = 0; // measures the average looptime +#endif + extern uint16_t tft_width; extern uint16_t tft_height; @@ -168,6 +172,10 @@ void loop() custom_loop(); #endif +#ifdef HASP_USE_STAT_COUNTER + statLoopCounter++; // measures the average looptime +#endif + /* Timer Loop */ if(millis() - mainLastLoopTime >= 1000) { /* Runs Every Second */ @@ -179,7 +187,7 @@ void loop() #endif #if defined(HASP_USE_CUSTOM) - custom_every_second(); + custom_every_second(); #endif /* Runs Every 5 Seconds */