Skip to content

Commit 2d08473

Browse files
committed
this version actually saves more code space on cortex-m0 with -Os (samd21s)
1 parent adca341 commit 2d08473

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

shared-module/adafruit_pixelbuf/PixelBuf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ STATIC color_u _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t col
198198
}
199199

200200
STATIC void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t *self, size_t index, color_u rgbw) {
201-
int r = rgbw.r;
202-
int g = rgbw.g;
203-
int b = rgbw.b;
204-
int w = rgbw.w;
201+
uint8_t r = rgbw.r;
202+
uint8_t g = rgbw.g;
203+
uint8_t b = rgbw.b;
204+
uint8_t w = rgbw.w;
205205
// DotStars don't have white, instead they have 5 bit brightness so pack it into w. Shift right
206206
// by three to leave the top five bits.
207207
if (self->bytes_per_pixel == 4 && self->byteorder.is_dotstar) {

0 commit comments

Comments
 (0)