From 7d7e66f60fb23d6bb3b9fe5449dbf006cb2876c4 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Wed, 23 Mar 2022 17:37:56 -0500 Subject: [PATCH] Fix no scaled framebuffer display --- shared-module/is31fl3741/FrameBuffer.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/shared-module/is31fl3741/FrameBuffer.c b/shared-module/is31fl3741/FrameBuffer.c index ebe630cacd..400f6f843d 100644 --- a/shared-module/is31fl3741/FrameBuffer.c +++ b/shared-module/is31fl3741/FrameBuffer.c @@ -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++; }