From f23f751ab04e9acde62ac45049bf4addaf18b69c Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 11 Sep 2018 15:59:05 +0200 Subject: [PATCH] extmod/modtrezorui: prepare display UI for model change --- embed/extmod/modtrezorui/display-unix.h | 2 +- embed/trezorhal/common.c | 2 -- embed/trezorhal/common.h | 3 +++ embed/unix/{background.jpg => background_T.jpg} | Bin embed/unix/common.c | 2 -- embed/unix/common.h | 3 +++ 6 files changed, 7 insertions(+), 5 deletions(-) rename embed/unix/{background.jpg => background_T.jpg} (100%) diff --git a/embed/extmod/modtrezorui/display-unix.h b/embed/extmod/modtrezorui/display-unix.h index d3c48ff2a7..c01d5f1953 100644 --- a/embed/extmod/modtrezorui/display-unix.h +++ b/embed/extmod/modtrezorui/display-unix.h @@ -91,7 +91,7 @@ void display_init(void) TEXTURE = SDL_CreateTexture(RENDERER, SDL_PIXELFORMAT_RGB565, SDL_TEXTUREACCESS_STREAMING, DISPLAY_RESX, DISPLAY_RESY); SDL_SetTextureBlendMode(TEXTURE, SDL_BLENDMODE_BLEND); // TODO: find better way how to embed/distribute background image - BACKGROUND = IMG_LoadTexture(RENDERER, "../embed/unix/background.jpg"); + BACKGROUND = IMG_LoadTexture(RENDERER, "../embed/unix/background_" XSTR(TREZOR_MODEL) ".jpg"); if (BACKGROUND) { SDL_SetTextureBlendMode(BACKGROUND, SDL_BLENDMODE_NONE); sdl_touch_offset_x = DISPLAY_TOUCH_OFFSET_X; diff --git a/embed/trezorhal/common.c b/embed/trezorhal/common.c index 673ee8a4bb..a01ae2ad54 100644 --- a/embed/trezorhal/common.c +++ b/embed/trezorhal/common.c @@ -45,8 +45,6 @@ void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, display_printf("func: %s\n", func); } #ifdef GITREV -#define XSTR(s) STR(s) -#define STR(s) #s display_printf("rev : %s\n", XSTR(GITREV)); #endif shutdown(); diff --git a/embed/trezorhal/common.h b/embed/trezorhal/common.h index d613aba563..9b6ebca91c 100644 --- a/embed/trezorhal/common.h +++ b/embed/trezorhal/common.h @@ -23,6 +23,9 @@ #include #include "secbool.h" +#define XSTR(s) STR(s) +#define STR(s) #s + #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif diff --git a/embed/unix/background.jpg b/embed/unix/background_T.jpg similarity index 100% rename from embed/unix/background.jpg rename to embed/unix/background_T.jpg diff --git a/embed/unix/common.c b/embed/unix/common.c index d5e27a572f..62a6686bb4 100644 --- a/embed/unix/common.c +++ b/embed/unix/common.c @@ -56,8 +56,6 @@ void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, printf("func: %s\n", func); } #ifdef GITREV -#define XSTR(s) STR(s) -#define STR(s) #s display_printf("rev : %s\n", XSTR(GITREV)); printf("rev : %s\n", XSTR(GITREV)); #endif diff --git a/embed/unix/common.h b/embed/unix/common.h index 8b79999a5e..4ff96dcff7 100644 --- a/embed/unix/common.h +++ b/embed/unix/common.h @@ -23,6 +23,9 @@ #include #include "secbool.h" +#define XSTR(s) STR(s) +#define STR(s) #s + #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif