fixes showing OnDiskBitmap with adafruit_sdcard
This commit is contained in:
parent
7611e71a1b
commit
e114b5ab54
@ -317,11 +317,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);
|
||||
|
@ -295,8 +295,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) {
|
||||
@ -305,6 +314,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,
|
||||
@ -78,7 +79,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