summaryrefslogtreecommitdiff
path: root/supervisor/shared/display.c
diff options
context:
space:
mode:
authorHierophect <hierophect@gmail.com>2019-07-24 14:54:22 -0400
committerHierophect <hierophect@gmail.com>2019-07-24 14:54:22 -0400
commitd66c9590af50ddd53286f92addd655109dbbcc36 (patch)
treece53fef7d7ebe8632899ff9f61be0d5056ab7143 /supervisor/shared/display.c
parent267468834da5207d66a8701d3b5b60a1f63e8461 (diff)
parentf39a6f40fdf3dfcd54ff3142255155f76da18016 (diff)
Merge tinyusb changes from upstream
Diffstat (limited to 'supervisor/shared/display.c')
-rw-r--r--supervisor/shared/display.c51
1 files changed, 42 insertions, 9 deletions
diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c
index c3afb3e00..6a39cbe8e 100644
--- a/supervisor/shared/display.c
+++ b/supervisor/shared/display.c
@@ -71,6 +71,8 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) {
if (tiles == NULL) {
return;
}
+ grid->y = 0;
+ grid->top_left_y = 0;
if (remaining_pixels > 0) {
grid->y -= (grid->tile_height - remaining_pixels);
}
@@ -80,8 +82,7 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) {
grid->pixel_height = height_in_tiles * grid->tile_height;
grid->tiles = tiles;
- supervisor_terminal.cursor_x = 0;
- supervisor_terminal.cursor_y = 0;
+ common_hal_terminalio_terminal_construct(&supervisor_terminal, grid, &supervisor_terminal_font);
}
void supervisor_stop_terminal(void) {
@@ -145,17 +146,49 @@ displayio_bitmap_t blinka_bitmap = {
.read_only = true
};
-uint32_t blinka_transparency[1] = {0x80000000};
-
-// These colors are RGB 565 with the bytes swapped.
-uint32_t blinka_colors[8] = {0x78890000, 0x9F86B8FC, 0xffff0D5A, 0x0000f501,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000};
+_displayio_color_t blinka_colors[7] = {
+ {
+ .rgb888 = 0x000000,
+ .rgb565 = 0x0000,
+ .luma = 0x00,
+ .transparent = true
+ },
+ {
+ .rgb888 = 0x8428bc,
+ .rgb565 = 0x7889,
+ .luma = 0xff // We cheat the luma here. It is actually 0x60
+ },
+ {
+ .rgb888 = 0xff89bc,
+ .rgb565 = 0xB8FC,
+ .luma = 0xb5
+ },
+ {
+ .rgb888 = 0x7beffe,
+ .rgb565 = 0x9F86,
+ .luma = 0xe0
+ },
+ {
+ .rgb888 = 0x51395f,
+ .rgb565 = 0x0D5A,
+ .luma = 0x47
+ },
+ {
+ .rgb888 = 0xffffff,
+ .rgb565 = 0xffff,
+ .luma = 0xff
+ },
+ {
+ .rgb888 = 0x0736a0,
+ .rgb565 = 0xf501,
+ .luma = 0x44
+ },
+};
displayio_palette_t blinka_palette = {
.base = {.type = &displayio_palette_type },
- .opaque = blinka_transparency,
.colors = blinka_colors,
- .color_count = 16,
+ .color_count = 7,
.needs_refresh = false
};