Edit about menu: Add new entry for serial number and compile info
This commit is contained in:
parent
f60545f664
commit
20fd7b41e6
@ -27,6 +27,7 @@
|
||||
#include <reflow-controller/safety-adc.h>
|
||||
#include <reflow-controller/temp-converter.h>
|
||||
#include <helper-macros/helper-macros.h>
|
||||
#include <stm-periph/unique-id.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
@ -114,6 +115,7 @@ static void reflow_menu_about(struct lcd_menu *menu, enum menu_entry_func_entry
|
||||
uint32_t uptime_hours;
|
||||
uint32_t uptime_days;
|
||||
int16_t rot_delta;
|
||||
uint32_t ser1, ser2, ser3;
|
||||
enum button_state push_button;
|
||||
|
||||
if (entry_type == MENU_ENTRY_FIRST_ENTER) {
|
||||
@ -130,7 +132,7 @@ static void reflow_menu_about(struct lcd_menu *menu, enum menu_entry_func_entry
|
||||
menu_lcd_output(menu, 0, LCD_SHIMATTA_STRING " Shimatta");
|
||||
menu_lcd_output(menu, 1, "Oven Controller");
|
||||
menu_lcd_output(menu, 2, "(c) Mario H\xF5ttel");
|
||||
menu_lcd_output(menu, 3, " Version->");
|
||||
menu_lcd_output(menu, 3, "Page 1/5");
|
||||
break;
|
||||
case 1:
|
||||
menu_lcd_output(menu, 0, "Version Number:");
|
||||
@ -138,16 +140,30 @@ static void reflow_menu_about(struct lcd_menu *menu, enum menu_entry_func_entry
|
||||
if (strlen(xstr(GIT_VER)) > LCD_CHAR_WIDTH) {
|
||||
menu_lcd_outputf(menu, 2, "%s", &xstr(GIT_VER)[LCD_CHAR_WIDTH]);
|
||||
}
|
||||
menu_lcd_output(menu, 3, "<-About Uptime->");
|
||||
menu_lcd_output(menu, 3, "Page 2/5");
|
||||
break;
|
||||
case 2:
|
||||
menu_lcd_output(menu, 0, "Compile Info");
|
||||
menu_lcd_output(menu, 1, __DATE__);
|
||||
menu_lcd_output(menu, 2, __TIME__);
|
||||
menu_lcd_output(menu, 3, "Page 3/5");
|
||||
break;
|
||||
case 3:
|
||||
unique_id_get(&ser1, &ser2, &ser3);
|
||||
|
||||
menu_lcd_outputf(menu, 0, "Serial: %08X", ser1);
|
||||
menu_lcd_outputf(menu, 1, " %08X", ser2);
|
||||
menu_lcd_outputf(menu, 2, " %08X", ser3);
|
||||
menu_lcd_output(menu, 3, "Page 4/5");
|
||||
break;
|
||||
case 4:
|
||||
systick_get_uptime_from_tick(&uptime_days, &uptime_hours, &uptime_mins, &new_uptime_secs);
|
||||
if (new_uptime_secs != uptime_secs) {
|
||||
uptime_secs = new_uptime_secs;
|
||||
menu_lcd_output(menu, 0, "Uptime:");
|
||||
menu_lcd_outputf(menu, 1, "%lu days %02lu:%02lu:%02lu",
|
||||
uptime_days, uptime_hours, uptime_mins, uptime_secs);
|
||||
menu_lcd_output(menu, 3, "<-Version");
|
||||
menu_lcd_outputf(menu, 1, "%lu day%s %02lu:%02lu:%02lu",
|
||||
uptime_days, (uptime_days == 1 ? "" : "s"), uptime_hours, uptime_mins, uptime_secs);
|
||||
menu_lcd_output(menu, 3, "Page 5/5");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -158,7 +174,7 @@ static void reflow_menu_about(struct lcd_menu *menu, enum menu_entry_func_entry
|
||||
rot_delta = menu_get_rotary_delta(menu);
|
||||
if (rot_delta >= 4) {
|
||||
menu_ack_rotary_delta(menu);
|
||||
if (page < 2) {
|
||||
if (page < 4) {
|
||||
page++;
|
||||
menu_display_clear(menu);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user