From 2d08473ee078625b5f6249c54bbbee266e9edafe Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 14 Nov 2022 21:18:40 -0600 Subject: [PATCH] this version actually saves more code space on cortex-m0 with -Os (samd21s) --- shared-module/adafruit_pixelbuf/PixelBuf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-module/adafruit_pixelbuf/PixelBuf.c b/shared-module/adafruit_pixelbuf/PixelBuf.c index e0c63306f9..5cbda5da96 100644 --- a/shared-module/adafruit_pixelbuf/PixelBuf.c +++ b/shared-module/adafruit_pixelbuf/PixelBuf.c @@ -198,10 +198,10 @@ STATIC color_u _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t col } STATIC void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t index, color_u rgbw) { - int r = rgbw.r; - int g = rgbw.g; - int b = rgbw.b; - int w = rgbw.w; + uint8_t r = rgbw.r; + uint8_t g = rgbw.g; + uint8_t b = rgbw.b; + uint8_t w = rgbw.w; // DotStars don't have white, instead they have 5 bit brightness so pack it into w. Shift right // by three to leave the top five bits. if (self->bytes_per_pixel == 4 && self->byteorder.is_dotstar) {