Skip to content

Commit 39d856f

Browse files
authored
Merge pull request #6192 from gamblor21/is31fl3741_fix
Fix no scaled framebuffer display
2 parents ac7977b + 7d7e66f commit 39d856f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

shared-module/is31fl3741/FrameBuffer.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,16 @@ void common_hal_is31fl3741_FrameBuffer_refresh(is31fl3741_FrameBuffer_obj_t *sel
184184
}
185185

186186
if ((dirty_row_flags >> (y % 8)) & 0x1) {
187-
uint32_t color = 0;
188-
if (self->auto_gamma) {
189-
color = IS31GammaTable[((*buffer) >> 16 & 0xFF)] +
190-
IS31GammaTable[((*buffer) >> 8 & 0xFF)] +
191-
IS31GammaTable[((*buffer) & 0xFF)];
192-
} else {
193-
color = *buffer;
194-
}
195-
196187
for (int x = 0; x < self->width; x++) {
188+
uint32_t color = 0;
189+
if (self->auto_gamma) {
190+
color = (IS31GammaTable[((*buffer) >> 16 & 0xFF)] << 16) +
191+
(IS31GammaTable[((*buffer) >> 8 & 0xFF)] << 8) +
192+
IS31GammaTable[((*buffer) & 0xFF)];
193+
} else {
194+
color = *buffer;
195+
}
196+
197197
common_hal_is31fl3741_draw_pixel(self->is31fl3741, x, y, color, self->mapping);
198198
buffer++;
199199
}

0 commit comments

Comments
 (0)