sanitize display code
This commit is contained in:
parent
09cc2f57b1
commit
6398516297
@ -151,6 +151,7 @@ void dp_refresh(bool nextPage) {
|
|||||||
|
|
||||||
#ifndef HAS_BUTTON
|
#ifndef HAS_BUTTON
|
||||||
static uint32_t framecounter = 0;
|
static uint32_t framecounter = 0;
|
||||||
|
const uint32_t flip_threshold = DISPLAYCYCLE * 1000 / DISPLAYREFRESH_MS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// if display is switched off we don't refresh it to relax cpu
|
// 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
|
#ifndef HAS_BUTTON
|
||||||
// auto flip page if we are in unattended mode
|
// auto flip page if we are in unattended mode
|
||||||
if ((++framecounter) > (DISPLAYCYCLE * 1000 / DISPLAYREFRESH_MS)) {
|
if (++framecounter > flip_threshold) {
|
||||||
framecounter = 0;
|
framecounter = 0;
|
||||||
nextPage = true;
|
nextPage = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user