sanitize display code

This commit is contained in:
cyberman54 committed 2022-08-14 15:49:32 +02:00
1 parent 09cc2f57b1
commit 6398516297
1 file changed
+2 -1
+2 -1
View File
@@ -151,6 +151,7 @@ void dp_refresh(bool nextPage) {
#ifndef HAS_BUTTON
static uint32_t framecounter = 0;
const uint32_t flip_threshold = DISPLAYCYCLE * 1000 / DISPLAYREFRESH_MS;
#endif
// if display is switched off we don't refresh it to relax cpu
@@ -165,7 +166,7 @@ void dp_refresh(bool nextPage) {
#ifndef HAS_BUTTON
// auto flip page if we are in unattended mode
if ((++framecounter) > (DISPLAYCYCLE * 1000 / DISPLAYREFRESH_MS)) {
if (++framecounter > flip_threshold) {
framecounter = 0;
nextPage = true;
}