Skip to content

Commit 8021f3b

Browse files
committed
framebufferio: handle sharp memory displays
A bit of cheating; we need to add a protocol getter for reverse_bytes_in_word
1 parent a84cc19 commit 8021f3b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

shared-module/framebufferio/FramebufferDisplay.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu
5151

5252
uint16_t ram_width = 0x100;
5353
uint16_t ram_height = 0x100;
54-
54+
uint16_t depth = self->framebuffer_protocol->get_color_depth(self->framebuffer);
5555
displayio_display_core_construct(
5656
&self->core,
5757
NULL,
@@ -62,12 +62,13 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu
6262
0,
6363
0,
6464
rotation,
65-
self->framebuffer_protocol->get_color_depth(self->framebuffer),
66-
false,
67-
false,
65+
depth,
66+
(depth < 12), // grayscale
67+
true, // pixels_in_byte_share_row
6868
self->framebuffer_protocol->get_bytes_per_cell(self->framebuffer),
69-
false,
70-
false);
69+
true, // reverse_pixels_in_byte
70+
false // reverse_bytes_in_word
71+
);
7172

7273
self->first_manual_refresh = !auto_refresh;
7374

0 commit comments

Comments
 (0)