commit
be6e6eabd2
@ -328,11 +328,10 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t*
|
||||
}
|
||||
|
||||
STATIC void _refresh_display(displayio_display_obj_t* self) {
|
||||
if (!displayio_display_core_bus_free(&self->core)) {
|
||||
// Can't acquire display bus; skip updating this display. Try next display.
|
||||
if (!displayio_display_core_start_refresh(&self->core)) {
|
||||
// A refresh on this bus is already in progress. Try next display.
|
||||
return;
|
||||
}
|
||||
displayio_display_core_start_refresh(&self->core);
|
||||
const displayio_area_t* current_area = _get_refresh_areas(self);
|
||||
while (current_area != NULL) {
|
||||
_refresh_area(self, current_area);
|
||||
|
@ -40,8 +40,6 @@ STATIC bool any_display_uses_this_framebuffer(mp_obj_base_t *obj) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// Check for recursive calls to displayio_background.
|
||||
bool displayio_background_in_progress = false;
|
||||
|
||||
void displayio_background(void) {
|
||||
if (mp_hal_is_interrupted()) {
|
||||
@ -52,12 +50,6 @@ void displayio_background(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (displayio_background_in_progress) {
|
||||
// Don't allow recursive calls to this routine.
|
||||
return;
|
||||
}
|
||||
|
||||
displayio_background_in_progress = true;
|
||||
|
||||
for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) {
|
||||
if (displays[i].display.base.type == NULL || displays[i].display.base.type == &mp_type_NoneType) {
|
||||
@ -75,8 +67,6 @@ void displayio_background(void) {
|
||||
}
|
||||
}
|
||||
|
||||
// All done.
|
||||
displayio_background_in_progress = false;
|
||||
}
|
||||
|
||||
void common_hal_displayio_release_displays(void) {
|
||||
|
@ -316,8 +316,17 @@ void displayio_display_core_set_region_to_update(displayio_display_core_t* self,
|
||||
}
|
||||
}
|
||||
|
||||
void displayio_display_core_start_refresh(displayio_display_core_t* self) {
|
||||
bool displayio_display_core_start_refresh(displayio_display_core_t* self) {
|
||||
if (!displayio_display_core_bus_free(self)) {
|
||||
// Can't acquire display bus; skip updating this display. Try next display.
|
||||
return false;
|
||||
}
|
||||
if (self->refresh_in_progress) {
|
||||
return false;
|
||||
}
|
||||
self->refresh_in_progress = true;
|
||||
self->last_refresh = supervisor_ticks_ms64();
|
||||
return true;
|
||||
}
|
||||
|
||||
void displayio_display_core_finish_refresh(displayio_display_core_t* self) {
|
||||
@ -326,6 +335,7 @@ void displayio_display_core_finish_refresh(displayio_display_core_t* self) {
|
||||
displayio_group_finish_refresh(self->current_group);
|
||||
}
|
||||
self->full_refresh = false;
|
||||
self->refresh_in_progress = false;
|
||||
self->last_refresh = supervisor_ticks_ms64();
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ typedef struct {
|
||||
int16_t colstart;
|
||||
int16_t rowstart;
|
||||
bool full_refresh; // New group means we need to refresh the whole display.
|
||||
bool refresh_in_progress;
|
||||
} displayio_display_core_t;
|
||||
|
||||
void displayio_display_core_construct(displayio_display_core_t* self,
|
||||
@ -81,7 +82,7 @@ void displayio_display_core_set_region_to_update(displayio_display_core_t* self,
|
||||
|
||||
void release_display_core(displayio_display_core_t* self);
|
||||
|
||||
void displayio_display_core_start_refresh(displayio_display_core_t* self);
|
||||
bool displayio_display_core_start_refresh(displayio_display_core_t* self);
|
||||
void displayio_display_core_finish_refresh(displayio_display_core_t* self);
|
||||
|
||||
void displayio_display_core_collect_ptrs(displayio_display_core_t* self);
|
||||
|
Loading…
x
Reference in New Issue
Block a user