this version actually saves more code space on cortex-m0 with -Os (samd21s)

This commit is contained in:
Jeff Epler 2022-11-14 21:18:40 -06:00
parent adca341d3b
commit 2d08473ee0
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -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) {