diff --git a/core/embed/bootloader/bootui.c b/core/embed/bootloader/bootui.c index 06061dff5a..1038252419 100644 --- a/core/embed/bootloader/bootui.c +++ b/core/embed/bootloader/bootui.c @@ -44,12 +44,20 @@ #define BACKLIGHT_NORMAL 150 -#define COLOR_BL_BG COLOR_WHITE // background -#define COLOR_BL_FG COLOR_BLACK // foreground +#define COLOR_BL_BG COLOR_WHITE // background +#define COLOR_BL_FG COLOR_BLACK // foreground + +#ifdef RGB16 #define COLOR_BL_FAIL RGB16(0xFF, 0x00, 0x00) // red #define COLOR_BL_DONE RGB16(0x00, 0xAE, 0x0B) // green #define COLOR_BL_PROCESS RGB16(0x4A, 0x90, 0xE2) // blue #define COLOR_BL_GRAY RGB16(0x99, 0x99, 0x99) // gray +#else +#define COLOR_BL_FAIL COLOR_BL_FG +#define COLOR_BL_DONE COLOR_BL_FG +#define COLOR_BL_PROCESS COLOR_BL_FG +#define COLOR_BL_GRAY COLOR_BL_FG +#endif #define COLOR_WELCOME_BG COLOR_WHITE // welcome background #define COLOR_WELCOME_FG COLOR_BLACK // welcome foreground @@ -84,7 +92,7 @@ void ui_screen_boot(const vendor_header *const vhdr, const image_header *const hdr) { const int show_string = ((vhdr->vtrust & VTRUST_STRING) == 0); if ((vhdr->vtrust & VTRUST_RED) == 0) { - boot_background = RGB16(0xFF, 0x00, 0x00); // red + boot_background = COLOR_BL_FAIL; } else { boot_background = COLOR_BLACK; } diff --git a/core/embed/bootloader_ci/bootui.c b/core/embed/bootloader_ci/bootui.c index 979cc87e7d..628aa4d424 100644 --- a/core/embed/bootloader_ci/bootui.c +++ b/core/embed/bootloader_ci/bootui.c @@ -30,11 +30,18 @@ #define BACKLIGHT_NORMAL 150 -#define COLOR_BL_BG COLOR_WHITE // background -#define COLOR_BL_FG COLOR_BLACK // foreground +#define COLOR_BL_BG COLOR_WHITE // background +#define COLOR_BL_FG COLOR_BLACK // foreground + +#ifdef RGB16 #define COLOR_BL_FAIL RGB16(0xFF, 0x00, 0x00) // red #define COLOR_BL_DONE RGB16(0x00, 0xAE, 0x0B) // green #define COLOR_BL_PROCESS RGB16(0x4A, 0x90, 0xE2) // blue +#else +#define COLOR_BL_FAIL COLOR_BL_FG +#define COLOR_BL_DONE COLOR_BL_FG +#define COLOR_BL_PROCESS COLOR_BL_FG +#endif #define COLOR_WELCOME_BG COLOR_WHITE // welcome background #define COLOR_WELCOME_FG COLOR_BLACK // welcome foreground diff --git a/core/embed/extmod/modtrezorui/display.h b/core/embed/extmod/modtrezorui/display.h index aefff21414..c9969a7b39 100644 --- a/core/embed/extmod/modtrezorui/display.h +++ b/core/embed/extmod/modtrezorui/display.h @@ -55,7 +55,10 @@ #define AVATAR_IMAGE_SIZE 144 #define LOADER_ICON_SIZE 64 +#ifdef TREZOR_MODEL_T #define RGB16(R, G, B) ((R & 0xF8) << 8) | ((G & 0xFC) << 3) | ((B & 0xF8) >> 3) +#endif + #define COLOR_WHITE 0xFFFF #define COLOR_BLACK 0x0000 diff --git a/core/embed/trezorhal/common.c b/core/embed/trezorhal/common.c index de6ac6f285..9b4a797dec 100644 --- a/core/embed/trezorhal/common.c +++ b/core/embed/trezorhal/common.c @@ -29,7 +29,11 @@ #include "stm32f4xx_ll_utils.h" +#ifdef RGB16 #define COLOR_FATAL_ERROR RGB16(0x7F, 0x00, 0x00) +#else +#define COLOR_FATAL_ERROR COLOR_BLACK +#endif // from util.s extern void shutdown_privileged(void); diff --git a/core/embed/unix/common.c b/core/embed/unix/common.c index 8538422a60..6b71b70579 100644 --- a/core/embed/unix/common.c +++ b/core/embed/unix/common.c @@ -32,7 +32,12 @@ void __shutdown(void) { main_clean_exit(3); } +#ifdef RGB16 #define COLOR_FATAL_ERROR RGB16(0x7F, 0x00, 0x00) +#else +// black on monochromatic displays +#define COLOR_FATAL_ERROR 0x0000 +#endif void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, const char *file, int line,