allow writing empty color frame

This commit is contained in:
Pepijn de Vos 2022-09-06 19:32:15 +02:00 committed by GitHub
parent 89a552618c
commit f69f517352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -275,7 +275,7 @@ STATIC bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t *
uint32_t mask[mask_length];
uint8_t passes = 1;
if (self->core.colorspace.tricolor || self->grayscale) {
if (self->write_color_ram_command != NO_COMMAND) {
passes = 2;
}
for (uint8_t pass = 0; pass < passes; pass++) {
@ -318,11 +318,14 @@ STATIC bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t *
if (pass == 1) {
if (self->grayscale) { // 4-color grayscale
self->core.colorspace.grayscale_bit = 6;
} else { // Tri-color
displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer);
} else if (self->core.colorspace.tricolor) {
self->core.colorspace.grayscale = false;
displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer);
}
} else {
displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer);
}
displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer);
// Invert it all.
if ((pass == 1 && self->color_bits_inverted) ||