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 <silseva@fastwebnet.it>
This commit is contained in:
Silvano Seva 2025-10-03 19:47:07 +02:00
parent c95f9ab6b6
commit 18cef67746
3 changed files with 8 additions and 0 deletions

View File

@ -129,8 +129,10 @@ enum displayItems
enum settingsGPSItems
{
G_ENABLED = 0,
#ifdef CONFIG_RTC
G_SET_TIME,
G_TIMEZONE
#endif
};
#endif

View File

@ -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(&currentLanguage->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;
}

View File

@ -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;
}