From 167108a91fb56f8a6b46bb2c42a3e4d5a6929f37 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 4 Aug 2022 14:53:49 -0700 Subject: [PATCH] Fix builds with displayio but not terminalio --- supervisor/shared/display.h | 8 +++++--- supervisor/supervisor.mk | 5 ++--- tools/gen_display_resources.py | 4 ++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/supervisor/shared/display.h b/supervisor/shared/display.h index 7979bc30ab..a7e28a8f75 100644 --- a/supervisor/shared/display.h +++ b/supervisor/shared/display.h @@ -29,10 +29,11 @@ #include +#include "shared-bindings/displayio/TileGrid.h" + #if CIRCUITPY_TERMINALIO #include "shared-bindings/displayio/Bitmap.h" -#include "shared-bindings/displayio/TileGrid.h" #include "shared-bindings/fontio/BuiltinFont.h" #include "shared-bindings/terminalio/Terminal.h" @@ -42,14 +43,15 @@ extern const fontio_builtinfont_t supervisor_terminal_font; // These will change so they must live in RAM. -extern displayio_tilegrid_t supervisor_blinka_sprite; extern displayio_bitmap_t supervisor_terminal_font_bitmap; extern displayio_tilegrid_t supervisor_terminal_scroll_area_text_grid; extern displayio_tilegrid_t supervisor_terminal_title_bar_text_grid; extern terminalio_terminal_obj_t supervisor_terminal; - #endif +// Always shown. +extern displayio_tilegrid_t supervisor_blinka_sprite; + void supervisor_start_terminal(uint16_t width_px, uint16_t height_px); void supervisor_stop_terminal(void); diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 912b5c5f37..cac5ac3911 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -184,9 +184,8 @@ ifeq ($(CIRCUITPY_DISPLAYIO), 1) SRC_SUPERVISOR += \ supervisor/shared/display.c - ifeq ($(CIRCUITPY_TERMINALIO), 1) - SUPERVISOR_O += $(BUILD)/autogen_display_resources-$(TRANSLATION).o - endif + # Include the display resources because it includes the Blinka logo as well. + SUPERVISOR_O += $(BUILD)/autogen_display_resources-$(TRANSLATION).o endif # Preserve double quotes in these values by single-quoting them. diff --git a/tools/gen_display_resources.py b/tools/gen_display_resources.py index e5e543b79c..5da6062823 100644 --- a/tools/gen_display_resources.py +++ b/tools/gen_display_resources.py @@ -104,6 +104,7 @@ c_file = args.output_c_file c_file.write( """\ +#include "shared-bindings/displayio/Bitmap.h" #include "shared-bindings/displayio/Palette.h" #include "supervisor/shared/display.h" @@ -266,6 +267,7 @@ displayio_tilegrid_t supervisor_blinka_sprite = {{ c_file.write( """\ +#if CIRCUITPY_TERMINALIO _displayio_color_t terminal_colors[2] = { { .rgb888 = 0x000000, @@ -414,5 +416,7 @@ terminalio_terminal_obj_t supervisor_terminal = { .scroll_area = NULL, .title_bar = NULL }; + +#endif """ )