From 34c1c3db4e01e5a3ac477104c2016ab4022be208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sun, 1 Jan 2023 21:12:19 +0100 Subject: [PATCH] Rework UI to use newly created version handling --- stm-firmware/ui/gui.c | 7 ++++--- stm-firmware/ui/shell.c | 10 ++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/stm-firmware/ui/gui.c b/stm-firmware/ui/gui.c index 9594941..670d363 100644 --- a/stm-firmware/ui/gui.c +++ b/stm-firmware/ui/gui.c @@ -18,6 +18,7 @@ * If not, see . */ +#include "reflow-controller/version.h" #include #include #include @@ -167,9 +168,9 @@ static void gui_menu_about(struct lcd_menu *menu, enum menu_entry_func_entry ent break; last_page = 1; menu_lcd_output(menu, 0, "Version Number:"); - menu_lcd_outputf(menu, 1, "%.*s", LCD_CHAR_WIDTH, xstr(GIT_VER)); - if (strlen(xstr(GIT_VER)) > LCD_CHAR_WIDTH) { - menu_lcd_outputf(menu, 2, "%s", &xstr(GIT_VER)[LCD_CHAR_WIDTH]); + menu_lcd_outputf(menu, 1, "%.*s", LCD_CHAR_WIDTH, version_git_version_string); + if (strlen(version_git_version_string) > LCD_CHAR_WIDTH) { + menu_lcd_outputf(menu, 2, "%s", &version_git_version_string[LCD_CHAR_WIDTH]); } #ifdef DEBUGBUILD menu_lcd_output(menu, 3, "Page 2/5 [DEBUG]"); diff --git a/stm-firmware/ui/shell.c b/stm-firmware/ui/shell.c index b82a42c..68fd94d 100644 --- a/stm-firmware/ui/shell.c +++ b/stm-firmware/ui/shell.c @@ -49,13 +49,10 @@ #include #include #include +#include #include -#ifndef GIT_VER -#define GIT_VER "VERSION NOT SET" -#endif - static shellmatta_instance_t shell; static char shell_buffer[512]; static char IN_SECTION(.ccm.bss) history_buffer[512]; @@ -81,8 +78,9 @@ static shellmatta_retCode_t shell_cmd_ver(const shellmatta_handle_t handle, stm_unique_id_get(&high_id, &mid_id, &low_id); stm_dev_rev_id_get(&stm_dev_id, &stm_rev_id); - shellmatta_printf(handle, "Reflow Oven Controller Firmware " xstr(GIT_VER) "\r\n" - "Compiled: " __DATE__ " at " __TIME__ "\r\n"); + shellmatta_printf(handle, "Reflow Oven Controller Firmware %s\r\n" + "Compiled: %s at %s\r\n", + version_git_version_string, version_compile_date, version_compile_time); shellmatta_printf(handle, "Serial: %08X-%08X-%08X\r\n", high_id, mid_id, low_id); pcb_rev = get_pcb_hardware_version();