Using MenuRenderer::updateTime with FreeRTOS on Arduino Mega may miss timeouts #321
Open
1 task done
Labels
bug
Something isn't working
Uh oh!
There was an error while loading. Please reload this page.
What happened?
Hi, when I used your library LcdMenu along with FreeRTOS for Arduino, with "lcd keypad shield".
I have noted that despite calling MenuRenderer::updateTimer regularly, the display won't timeout. I'm using LcdMenu version 5.8.0.
I checked the source of this function, and I realized that to find the timeout, you have used the following:
millis() != startTime + DISPLAY_TIMEOUT
As this check is for equality, it may be missed specially with busy systems (as I undestood, so if I'm wrong please let me know). So I have defined a boolean variable named "isShowing", and changed the "!=" sign to "<", and used the following logic:
I also initialized "isShowing" with "true" (in header file in definition, begin and in restartTime function), and solved my problem.
Version
What environment are you seeing the problem in?
Arduino
Board type
Arduino Mega 2560
Relevant log output
The text was updated successfully, but these errors were encountered: