Skip to content

Commit bcb9cd1

Browse files
committed
don't start refresh until we know bus is available
1 parent 8df888e commit bcb9cd1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

shared-module/busdisplay/BusDisplay.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,15 @@ static bool _refresh_area(busdisplay_busdisplay_obj_t *self, const displayio_are
309309
}
310310

311311
static void _refresh_display(busdisplay_busdisplay_obj_t *self) {
312-
if (!displayio_display_core_start_refresh(&self->core)) {
313-
// Refresh for this display already in progress.
314-
return;
315-
}
316312
if (!displayio_display_bus_is_free(&self->bus)) {
317313
// A refresh on this bus is already in progress. Try next display.
318314
return;
319315
}
316+
if (!displayio_display_core_start_refresh(&self->core)) {
317+
// Refresh for this display already in progress.
318+
return;
319+
}
320+
320321
const displayio_area_t *current_area = _get_refresh_areas(self);
321322
while (current_area != NULL) {
322323
_refresh_area(self, current_area);

shared-module/epaperdisplay/EPaperDisplay.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,14 @@ void epaperdisplay_epaperdisplay_change_refresh_mode_parameters(epaperdisplay_ep
187187
}
188188

189189
static void epaperdisplay_epaperdisplay_start_refresh(epaperdisplay_epaperdisplay_obj_t *self) {
190-
if (!displayio_display_core_start_refresh(&self->core)) {
191-
// Refresh on this display already in progress.
192-
return;
193-
}
194-
195190
if (!displayio_display_bus_is_free(&self->bus)) {
196191
// Can't acquire display bus; skip updating this display. Try next display.
197192
return;
198193
}
194+
if (!displayio_display_core_start_refresh(&self->core)) {
195+
// Refresh on this display already in progress.
196+
return;
197+
}
199198

200199
// run start sequence
201200
self->bus.bus_reset(self->bus.bus);

0 commit comments

Comments
 (0)