From de3b3195189696e65fa9cee8b70858c0c1fb05a2 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Thu, 7 Sep 2023 11:44:09 +0200 Subject: [PATCH] ttwrplus: added SA868 firmware version to info menu --- openrtx/src/ui/default/ui.c | 6 +++++- openrtx/src/ui/default/ui_menu.c | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/openrtx/src/ui/default/ui.c b/openrtx/src/ui/default/ui.c index 35c61984..3428c414 100644 --- a/openrtx/src/ui/default/ui.c +++ b/openrtx/src/ui/default/ui.c @@ -192,7 +192,11 @@ const char *info_items[] = "Band", "VHF", "UHF", - "Hw Version" + "Hw Version", +#ifdef PLATFORM_TTWRPLUS + "Radio", + "Radio FW", +#endif }; const char *authors[] = diff --git a/openrtx/src/ui/default/ui_menu.c b/openrtx/src/ui/default/ui_menu.c index 8a5231ff..4da4d757 100644 --- a/openrtx/src/ui/default/ui_menu.c +++ b/openrtx/src/ui/default/ui_menu.c @@ -31,6 +31,10 @@ #include #include +#ifdef PLATFORM_TTWRPLUS +#include +#endif + /* UI main screen helper functions, their implementation is in "ui_main.c" */ extern void _ui_drawMainBottom(); @@ -453,6 +457,21 @@ int _ui_getInfoValueName(char *buf, uint8_t max_len, uint8_t index) case 8: // LCD Type snprintf(buf, max_len, "%d", hwinfo->hw_version); break; + #ifdef PLATFORM_TTWRPLUS + case 9: // Radio model + strncpy(buf, sa8x8_getModel(), max_len); + break; + case 10: // Radio firmware version + { + // Get FW version string, skip the first nine chars ("sa8x8-fw/") + uint8_t major, minor, patch, release; + const char *fwVer = sa8x8_getFwVersion(); + + sscanf(fwVer, "sa8x8-fw/v%hhu.%hhu.%hhu.r%hhu", &major, &minor, &patch, &release); + snprintf(buf, max_len,"v%hhu.%hhu.%hhu.r%hhu", major, minor, patch, release); + } + break; + #endif } return 0; }