diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2021-11-25 22:18:44 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2022-02-07 22:04:10 +0100 |
commit | 95dfc489b5a602f68202b206c434f8485e9d3915 (patch) | |
tree | e19441973a90fa10d2f990de2ebb10459b713215 /apps | |
parent | 5b8873bf333add9ec7208901c62bbd30ad7ea8c3 (diff) | |
download | rockbox-95dfc489b5a602f68202b206c434f8485e9d3915.tar.gz rockbox-95dfc489b5a602f68202b206c434f8485e9d3915.zip |
sync clock with RDS time
Tested with my SansaClip+. I don't think this will need extra battery
but let me know if I am wrong.
Change-Id: I287dae134113e0f8a138af68f5087b8ea45b0f4c
Diffstat (limited to 'apps')
-rw-r--r-- | apps/features.txt | 4 | ||||
-rw-r--r-- | apps/lang/english.lang | 17 | ||||
-rw-r--r-- | apps/menus/radio_menu.c | 6 | ||||
-rw-r--r-- | apps/menus/time_menu.c | 6 | ||||
-rw-r--r-- | apps/settings.h | 3 | ||||
-rw-r--r-- | apps/settings_list.c | 3 |
6 files changed, 39 insertions, 0 deletions
diff --git a/apps/features.txt b/apps/features.txt index ec2113cbc8..45e06e5e64 100644 --- a/apps/features.txt +++ b/apps/features.txt | |||
@@ -105,6 +105,10 @@ radio_remote | |||
105 | #endif | 105 | #endif |
106 | #endif | 106 | #endif |
107 | 107 | ||
108 | #if defined(HAVE_RDS_CAP) | ||
109 | rds | ||
110 | #endif | ||
111 | |||
108 | #if defined(HAVE_RECORDING) | 112 | #if defined(HAVE_RECORDING) |
109 | recording | 113 | recording |
110 | #if defined(HAVE_LINE_IN) | 114 | #if defined(HAVE_LINE_IN) |
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 43d73a8445..c951028494 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -16229,3 +16229,20 @@ | |||
16229 | *: "Prefer Image File" | 16229 | *: "Prefer Image File" |
16230 | </voice> | 16230 | </voice> |
16231 | </phrase> | 16231 | </phrase> |
16232 | <phrase> | ||
16233 | id: LANG_FM_SYNC_RDS_TIME | ||
16234 | desc: in radio screen and Settings | ||
16235 | user: core | ||
16236 | <source> | ||
16237 | *: none | ||
16238 | rds: "Sync RDS Time" | ||
16239 | </source> | ||
16240 | <dest> | ||
16241 | *: none | ||
16242 | rds: "Sync RDS Time" | ||
16243 | </dest> | ||
16244 | <voice> | ||
16245 | *: none | ||
16246 | rds: "Sync RDS Time" | ||
16247 | </voice> | ||
16248 | </phrase> | ||
diff --git a/apps/menus/radio_menu.c b/apps/menus/radio_menu.c index a6d259a21d..682cecf2b4 100644 --- a/apps/menus/radio_menu.c +++ b/apps/menus/radio_menu.c | |||
@@ -87,6 +87,9 @@ MENUITEM_FUNCTION(presetclear_item, 0, ID2P(LANG_FM_PRESET_CLEAR), | |||
87 | 87 | ||
88 | MENUITEM_SETTING(set_region, &global_settings.fm_region, NULL); | 88 | MENUITEM_SETTING(set_region, &global_settings.fm_region, NULL); |
89 | MENUITEM_SETTING(force_mono, &global_settings.fm_force_mono, NULL); | 89 | MENUITEM_SETTING(force_mono, &global_settings.fm_force_mono, NULL); |
90 | #if defined(HAVE_RDS_CAP) && defined(CONFIG_RTC) | ||
91 | MENUITEM_SETTING(sync_rds_time, &global_settings.sync_rds_time, NULL); | ||
92 | #endif | ||
90 | 93 | ||
91 | #ifndef FM_MODE | 94 | #ifndef FM_MODE |
92 | extern int radio_mode; | 95 | extern int radio_mode; |
@@ -147,5 +150,8 @@ MAKE_MENU(radio_settings_menu, ID2P(LANG_FM_MENU), NULL, | |||
147 | #ifdef FM_RECORDING_SETTINGS | 150 | #ifdef FM_RECORDING_SETTINGS |
148 | &recsettings_item, | 151 | &recsettings_item, |
149 | #endif | 152 | #endif |
153 | #if defined(HAVE_RDS_CAP) && defined(CONFIG_RTC) | ||
154 | &sync_rds_time, | ||
155 | #endif | ||
150 | &scan_presets_item); | 156 | &scan_presets_item); |
151 | 157 | ||
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c index edd2e19a2b..674279c01a 100644 --- a/apps/menus/time_menu.c +++ b/apps/menus/time_menu.c | |||
@@ -242,6 +242,9 @@ static int time_menu_callback(int action, | |||
242 | return action; | 242 | return action; |
243 | } | 243 | } |
244 | 244 | ||
245 | #if defined(HAVE_RDS_CAP) && defined(CONFIG_RTC) | ||
246 | MENUITEM_SETTING(sync_rds_time, &global_settings.sync_rds_time, NULL); | ||
247 | #endif | ||
245 | 248 | ||
246 | MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), time_menu_callback, Icon_NOICON, | 249 | MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), time_menu_callback, Icon_NOICON, |
247 | &time_set, | 250 | &time_set, |
@@ -251,6 +254,9 @@ MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), time_menu_callback, Icon_NOICON, | |||
251 | &alarm_wake_up_screen, | 254 | &alarm_wake_up_screen, |
252 | #endif | 255 | #endif |
253 | #endif | 256 | #endif |
257 | #if defined(HAVE_RDS_CAP) && defined(CONFIG_RTC) | ||
258 | &sync_rds_time, | ||
259 | #endif | ||
254 | &timeformat); | 260 | &timeformat); |
255 | 261 | ||
256 | int time_screen(void* ignored) | 262 | int time_screen(void* ignored) |
diff --git a/apps/settings.h b/apps/settings.h index 936280ba5a..8ff006d682 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -458,6 +458,9 @@ struct user_settings | |||
458 | unsigned char rfms_file[MAX_FILENAME+1]; /* last remote-fms */ | 458 | unsigned char rfms_file[MAX_FILENAME+1]; /* last remote-fms */ |
459 | #endif | 459 | #endif |
460 | #endif /* CONFIG_TUNER */ | 460 | #endif /* CONFIG_TUNER */ |
461 | #if defined(HAVE_RDS_CAP) && defined(CONFIG_RTC) | ||
462 | bool sync_rds_time; /* use RDS time to set the clock */ | ||
463 | #endif | ||
461 | 464 | ||
462 | /* misc options */ | 465 | /* misc options */ |
463 | #ifndef HAVE_WHEEL_ACCELERATION | 466 | #ifndef HAVE_WHEEL_ACCELERATION |
diff --git a/apps/settings_list.c b/apps/settings_list.c index 7b24db22e5..aa2ebbf883 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -1096,6 +1096,9 @@ const struct settings_list settings[] = { | |||
1096 | false, "force fm mono", toggle_mono_mode), | 1096 | false, "force fm mono", toggle_mono_mode), |
1097 | SYSTEM_SETTING(NVRAM(4), last_frequency, 0), | 1097 | SYSTEM_SETTING(NVRAM(4), last_frequency, 0), |
1098 | #endif | 1098 | #endif |
1099 | #if defined(HAVE_RDS_CAP) && defined(CONFIG_RTC) | ||
1100 | OFFON_SETTING(0, sync_rds_time, LANG_FM_SYNC_RDS_TIME, false, "sync_rds_time", NULL), | ||
1101 | #endif | ||
1099 | 1102 | ||
1100 | #if BATTERY_TYPES_COUNT > 1 | 1103 | #if BATTERY_TYPES_COUNT > 1 |
1101 | CHOICE_SETTING(0, battery_type, LANG_BATTERY_TYPE, 0, "battery type", | 1104 | CHOICE_SETTING(0, battery_type, LANG_BATTERY_TYPE, 0, "battery type", |