Skip to content

Commit

Permalink
Merge pull request #6192 from gamblor21/is31fl3741_fix
Browse files Browse the repository at this point in the history
Fix no scaled framebuffer display
  • Loading branch information
tannewt authored Mar 24, 2022
2 parents ac7977b + 7d7e66f commit 39d856f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions shared-module/is31fl3741/FrameBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,16 @@ void common_hal_is31fl3741_FrameBuffer_refresh(is31fl3741_FrameBuffer_obj_t *sel
}

if ((dirty_row_flags >> (y % 8)) & 0x1) {
uint32_t color = 0;
if (self->auto_gamma) {
color = IS31GammaTable[((*buffer) >> 16 & 0xFF)] +
IS31GammaTable[((*buffer) >> 8 & 0xFF)] +
IS31GammaTable[((*buffer) & 0xFF)];
} else {
color = *buffer;
}

for (int x = 0; x < self->width; x++) {
uint32_t color = 0;
if (self->auto_gamma) {
color = (IS31GammaTable[((*buffer) >> 16 & 0xFF)] << 16) +
(IS31GammaTable[((*buffer) >> 8 & 0xFF)] << 8) +
IS31GammaTable[((*buffer) & 0xFF)];
} else {
color = *buffer;
}

common_hal_is31fl3741_draw_pixel(self->is31fl3741, x, y, color, self->mapping);
buffer++;
}
Expand Down

0 comments on commit 39d856f

Please sign in to comment.