mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Fix statLoopCounter overflow
This commit is contained in:
parent
2e7a772668
commit
35975131b3
@ -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()
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user