Skip to content

Commit d84d9f4

Browse files
committed
Added PEN_RGB332 support
1 parent 884722d commit d84d9f4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

libraries/galactic_unicorn/galactic_unicorn.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,21 @@ namespace pimoroni {
557557
uint8_t b = (col & 0b0000000000011111) << 3;
558558
p++;
559559

560+
set_pixel(x, y, r, g, b);
561+
}
562+
}
563+
else if(graphics->pen_type == PicoGraphics::PEN_RGB332) {
564+
uint8_t *p = (uint8_t *)graphics->frame_buffer;
565+
for(size_t j = 0; j < 53 * 11; j++) {
566+
int x = j % 53;
567+
int y = j / 53;
568+
569+
uint8_t col = *p;
570+
uint8_t r = (col & 0b11100000);
571+
uint8_t g = (col & 0b00011100) << 3;
572+
uint8_t b = (col & 0b00000011) << 6;
573+
p++;
574+
560575
set_pixel(x, y, r, g, b);
561576
}
562577
}

0 commit comments

Comments
 (0)