diff --git a/micropython/bootloader/main.c b/micropython/bootloader/main.c index bf43942b11..8761628c5d 100644 --- a/micropython/bootloader/main.c +++ b/micropython/bootloader/main.c @@ -6,6 +6,7 @@ #include "display.h" #include "image.h" #include "sdcard.h" +#include "version.h" #define BOOTLOADER_FGCOLOR 0xFFFF #define BOOTLOADER_BGCOLOR 0x0000 @@ -155,7 +156,7 @@ int main(void) display_clear(); display_backlight(255); - BOOTLOADER_PRINTLN("TREZOR Bootloader"); + BOOTLOADER_PRINTLN("TREZOR Bootloader " VERSION_STR); BOOTLOADER_PRINTLN("================="); BOOTLOADER_PRINTLN("starting bootloader"); diff --git a/micropython/bootloader/version.h b/micropython/bootloader/version.h new file mode 100644 index 0000000000..cb1e4a0919 --- /dev/null +++ b/micropython/bootloader/version.h @@ -0,0 +1,9 @@ +#define VERSION_MAJOR 0 +#define VERSION_MINOR 1 +#define VERSION_PATCH 0 +#define VERSION_BUILD 0 + +#define STR_HELPER(X) #X +#define STRINGIZE(X) STR_HELPER(X) + +#define VERSION_STR STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "." STRINGIZE(VERSION_PATCH) "." STRINGIZE(VERSION_BUILD) diff --git a/micropython/firmware/version.h b/micropython/firmware/version.h index a62341fe92..cb1e4a0919 100644 --- a/micropython/firmware/version.h +++ b/micropython/firmware/version.h @@ -2,3 +2,8 @@ #define VERSION_MINOR 1 #define VERSION_PATCH 0 #define VERSION_BUILD 0 + +#define STR_HELPER(X) #X +#define STRINGIZE(X) STR_HELPER(X) + +#define VERSION_STR STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "." STRINGIZE(VERSION_PATCH) "." STRINGIZE(VERSION_BUILD) diff --git a/micropython/loader/main.c b/micropython/loader/main.c index e23cd9fb62..1f7ad02295 100644 --- a/micropython/loader/main.c +++ b/micropython/loader/main.c @@ -6,6 +6,7 @@ #include "display.h" #include "image.h" #include "touch.h" +#include "version.h" #define LOADER_FGCOLOR 0xFFFF #define LOADER_BGCOLOR 0x0000 @@ -102,7 +103,7 @@ int main(void) display_clear(); display_backlight(255); - LOADER_PRINTLN("TREZOR Loader"); + LOADER_PRINTLN("TREZOR Loader " VERSION_STR); LOADER_PRINTLN("============="); LOADER_PRINTLN("starting loader"); diff --git a/micropython/loader/version.h b/micropython/loader/version.h index a62341fe92..cb1e4a0919 100644 --- a/micropython/loader/version.h +++ b/micropython/loader/version.h @@ -2,3 +2,8 @@ #define VERSION_MINOR 1 #define VERSION_PATCH 0 #define VERSION_BUILD 0 + +#define STR_HELPER(X) #X +#define STRINGIZE(X) STR_HELPER(X) + +#define VERSION_STR STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "." STRINGIZE(VERSION_PATCH) "." STRINGIZE(VERSION_BUILD)