Skip to content

Commit 330e6e9

Browse files
committed
Move epaper refresh test
1 parent 6e1b516 commit 330e6e9

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

shared-module/epaperdisplay/EPaperDisplay.c

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -512,28 +512,6 @@ size_t maybe_refresh_epaperdisplay(void) {
512512
#endif
513513

514514
for (uint8_t i = 0; i < max_num_displays; i++) {
515-
#if CIRCUITPY_OS_GETENV && CIRCUITPY_SET_DISPLAY_LIMIT
516-
if (i < CIRCUITPY_DISPLAY_LIMIT) {
517-
if (displays[i].epaper_display.base.type != &epaperdisplay_epaperdisplay_type ||
518-
displays[i].epaper_display.core.current_group != &circuitpython_splash) {
519-
// Skip regular displays and those not showing the splash.
520-
continue;
521-
}
522-
} else {
523-
if (displays_dyn[i - CIRCUITPY_DISPLAY_LIMIT].epaper_display.base.type != &epaperdisplay_epaperdisplay_type ||
524-
displays_dyn[i - CIRCUITPY_DISPLAY_LIMIT].epaper_display.core.current_group != &circuitpython_splash) {
525-
// Skip regular displays and those not showing the splash.
526-
continue;
527-
}
528-
}
529-
#else
530-
if (displays[i].epaper_display.base.type != &epaperdisplay_epaperdisplay_type ||
531-
displays[i].epaper_display.core.current_group != &circuitpython_splash) {
532-
// Skip regular displays and those not showing the splash.
533-
continue;
534-
}
535-
#endif
536-
537515
epaperdisplay_epaperdisplay_obj_t *display;
538516
#if CIRCUITPY_OS_GETENV && CIRCUITPY_SET_DISPLAY_LIMIT
539517
if (i < CIRCUITPY_DISPLAY_LIMIT) {
@@ -544,6 +522,13 @@ size_t maybe_refresh_epaperdisplay(void) {
544522
#else
545523
display = &displays[i].epaper_display;
546524
#endif
525+
526+
if (display.base.type != &epaperdisplay_epaperdisplay_type ||
527+
display.core.current_group != &circuitpython_splash) {
528+
// Skip regular displays and those not showing the splash.
529+
continue;
530+
}
531+
547532
size_t time_to_refresh = common_hal_epaperdisplay_epaperdisplay_get_time_to_refresh(display);
548533
if (time_to_refresh > 0) {
549534
return time_to_refresh;

0 commit comments

Comments
 (0)