diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index d7353966..8b7f23ed 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -112,38 +112,42 @@ const char *menu_items[8] = }; #ifdef HAS_RTC -const char *settings_items[2] = +const char *settings_items[] = { "Time & Date", "Display" }; #else -const char *settings_items[1] = +const char *settings_items[] = { "Display" }; #endif #ifdef SCREEN_CONTRAST -const char *display_items[2] = +const char *display_items[] = { "Brightness", "Contrast" }; #else -const char *display_items[1] = +const char *display_items[] = { "Brightness", }; #endif -const char *info_items[4] = +const char *info_items[] = { - "Model", "Bat. Voltage", "Bat. Charge", "RSSI", + "Model", + "Band", + "VHF", + "UHF", + "LCD Type" }; -const char *authors[4] = +const char *authors[] = { "Niccolo' IU2KIN", "Silvano IU2KWO", diff --git a/openrtx/src/ui/ui_menu.c b/openrtx/src/ui/ui_menu.c index d06f969b..c3d7f2b7 100644 --- a/openrtx/src/ui/ui_menu.c +++ b/openrtx/src/ui/ui_menu.c @@ -23,6 +23,7 @@ #include #include #include +#include void _ui_drawMenuList(point_t pos, uint8_t selected, int (*getCurrentEntry)(char *buf, uint8_t max_len, uint8_t index)) { @@ -132,15 +133,24 @@ int _ui_getInfoEntryName(char *buf, uint8_t max_len, uint8_t index) int _ui_getInfoValueName(char *buf, uint8_t max_len, uint8_t index) { + const hwInfo_t* hwinfo = platform_getHwInfo(); if(index >= info_num) return -1; - if(strcmp(info_items[index], "Model") == 0) - snprintf(buf, max_len, "%s", ""); else if(strcmp(info_items[index], "Bat. Voltage") == 0) snprintf(buf, max_len, "%.1fV", last_state.v_bat); else if(strcmp(info_items[index], "Bat. Charge") == 0) snprintf(buf, max_len, "%.1f%%", last_state.charge * 100); else if(strcmp(info_items[index], "RSSI") == 0) snprintf(buf, max_len, "%.1fdBm", last_state.rssi); + if(strcmp(info_items[index], "Model") == 0) + snprintf(buf, max_len, "%s", hwinfo->name); + if(strcmp(info_items[index], "Band") == 0) + snprintf(buf, max_len, "%s %s", hwinfo->vhf_band ? "VHF" : "", hwinfo->uhf_band ? "UHF" : ""); + else if(strcmp(info_items[index], "VHF") == 0) + snprintf(buf, max_len, "%d - %d", hwinfo->vhf_minFreq, hwinfo->vhf_maxFreq); + else if(strcmp(info_items[index], "UHF") == 0) + snprintf(buf, max_len, "%d - %d", hwinfo->uhf_minFreq, hwinfo->uhf_maxFreq); + else if(strcmp(info_items[index], "LCD Type") == 0) + snprintf(buf, max_len, "%d", hwinfo->lcd_type); return 0; } diff --git a/platform/targets/linux/platform.c b/platform/targets/linux/platform.c index b6fb845f..481b590d 100644 --- a/platform/targets/linux/platform.c +++ b/platform/targets/linux/platform.c @@ -20,9 +20,15 @@ #include #include "emulator.h" +hwInfo_t hwInfo; + void platform_init() { //printf("Platform init\n"); + // Fill hwinfo struct + snprintf(hwInfo.name, 10, "Linux"); + hwInfo.vhf_band = 1; + hwInfo.uhf_band = 1; } void platform_terminate() @@ -111,3 +117,8 @@ const void *platform_getCalibrationData() { return NULL; } + +const hwInfo_t *platform_getHwInfo() +{ + return &hwInfo; +}