From 18cef67746d0585851850c18289b299586a717dc Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Fri, 3 Oct 2025 19:47:07 +0200 Subject: [PATCH] ui: gps: hide RTC settings if there is no RTC Show settings entries for RTC synchronization and UTC timezone only if the CONFIG_RTC macro is present Signed-off-by: Silvano Seva --- openrtx/include/ui/ui_default.h | 2 ++ openrtx/src/ui/default/ui.c | 4 ++++ openrtx/src/ui/default/ui_menu.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/openrtx/include/ui/ui_default.h b/openrtx/include/ui/ui_default.h index 55d9059d..40e4102f 100644 --- a/openrtx/include/ui/ui_default.h +++ b/openrtx/include/ui/ui_default.h @@ -129,8 +129,10 @@ enum displayItems enum settingsGPSItems { G_ENABLED = 0, +#ifdef CONFIG_RTC G_SET_TIME, G_TIMEZONE +#endif }; #endif diff --git a/openrtx/src/ui/default/ui.c b/openrtx/src/ui/default/ui.c index a746b630..aaf37401 100644 --- a/openrtx/src/ui/default/ui.c +++ b/openrtx/src/ui/default/ui.c @@ -167,8 +167,10 @@ const char *display_items[] = const char *settings_gps_items[] = { "GPS Enabled", +#ifdef CONFIG_RTC "GPS Set Time", "UTC Timezone" +#endif }; #endif @@ -2155,6 +2157,7 @@ void ui_updateFSM(bool *sync_rtx) queueFlags, state.settings.gps_enabled); break; +#ifdef CONFIG_RTC case G_SET_TIME: state.settings.gpsSetTime = !state.settings.gpsSetTime; vp_announceSettingsOnOffToggle(¤tLanguage->gpsSetTime, @@ -2170,6 +2173,7 @@ void ui_updateFSM(bool *sync_rtx) state.settings.utc_timezone += 1; vp_announceTimeZone(state.settings.utc_timezone, queueFlags); break; +#endif default: state.ui_screen = SETTINGS_GPS; } diff --git a/openrtx/src/ui/default/ui_menu.c b/openrtx/src/ui/default/ui_menu.c index 9545cd20..ff9fca70 100644 --- a/openrtx/src/ui/default/ui_menu.c +++ b/openrtx/src/ui/default/ui_menu.c @@ -315,6 +315,7 @@ int _ui_getSettingsGPSValueName(char *buf, uint8_t max_len, uint8_t index) currentLanguage->on : currentLanguage->off); break; +#ifdef CONFIG_RTC case G_SET_TIME: sniprintf(buf, max_len, "%s", (last_state.settings.gpsSetTime) ? currentLanguage->on : @@ -340,6 +341,7 @@ int _ui_getSettingsGPSValueName(char *buf, uint8_t max_len, uint8_t index) sniprintf(buf, max_len, "%c%d.%d", sign, tz_hr, tz_mn); } break; +#endif } return 0; }