diff options
-rw-r--r-- | apps/main_menu.c | 65 | ||||
-rw-r--r-- | apps/recorder/radio.c | 12 | ||||
-rw-r--r-- | apps/recorder/radio.h | 1 |
3 files changed, 61 insertions, 17 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c index 8a657f90f6..c1faf815fe 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c | |||
@@ -266,34 +266,65 @@ bool main_menu(void) | |||
266 | { | 266 | { |
267 | int m; | 267 | int m; |
268 | bool result; | 268 | bool result; |
269 | int i = 0; | ||
269 | 270 | ||
270 | /* main menu */ | 271 | /* main menu */ |
271 | struct menu_items items[] = { | 272 | struct menu_items items[14]; |
272 | { str(LANG_SOUND_SETTINGS), sound_menu }, | 273 | |
273 | { str(LANG_GENERAL_SETTINGS), settings_menu }, | 274 | items[i].desc = str(LANG_SOUND_SETTINGS); |
275 | items[i++].function = sound_menu; | ||
276 | |||
277 | items[i].desc = str(LANG_GENERAL_SETTINGS); | ||
278 | items[i++].function = settings_menu; | ||
279 | |||
274 | #ifdef HAVE_FMRADIO | 280 | #ifdef HAVE_FMRADIO |
275 | { str(LANG_FM_RADIO), radio_screen }, | 281 | if(radio_hardware_present()) { |
282 | items[i].desc = str(LANG_FM_RADIO); | ||
283 | items[i++].function = radio_screen; | ||
284 | } | ||
276 | #endif | 285 | #endif |
286 | |||
277 | #ifdef HAVE_MAS3587F | 287 | #ifdef HAVE_MAS3587F |
278 | { str(LANG_RECORDING), recording_screen }, | 288 | items[i].desc = str(LANG_RECORDING); |
279 | { str(LANG_RECORDING_SETTINGS), recording_settings}, | 289 | items[i++].function = recording_screen; |
290 | |||
291 | items[i].desc = str(LANG_RECORDING_SETTINGS); | ||
292 | items[i++].function = recording_settings; | ||
280 | #endif | 293 | #endif |
281 | { str(LANG_PLAYLIST_MENU), playlist_menu }, | 294 | |
282 | { str(LANG_MENU_SHOW_ID3_INFO), browse_id3 }, | 295 | items[i].desc = str(LANG_PLAYLIST_MENU); |
283 | { str(LANG_SLEEP_TIMER), sleeptimer_screen }, | 296 | items[i++].function = playlist_menu; |
297 | |||
298 | items[i].desc = str(LANG_MENU_SHOW_ID3_INFO); | ||
299 | items[i++].function = browse_id3; | ||
300 | |||
301 | items[i].desc = str(LANG_SLEEP_TIMER); | ||
302 | items[i++].function = sleeptimer_screen; | ||
303 | |||
284 | #ifdef HAVE_ALARM_MOD | 304 | #ifdef HAVE_ALARM_MOD |
285 | { str(LANG_ALARM_MOD_ALARM_MENU), alarm_screen }, | 305 | items[i].desc = str(LANG_ALARM_MOD_ALARM_MENU); |
306 | items[i++].function = alarm_screen; | ||
286 | #endif | 307 | #endif |
287 | { str(LANG_PLUGINS), plugin_browse }, | 308 | |
288 | { str(LANG_FIRMWARE), firmware_browse }, | 309 | items[i].desc = str(LANG_PLUGINS); |
289 | { str(LANG_INFO), show_info }, | 310 | items[i++].function = plugin_browse; |
290 | { str(LANG_VERSION), show_credits }, | 311 | |
312 | items[i].desc = str(LANG_FIRMWARE); | ||
313 | items[i++].function = firmware_browse; | ||
314 | |||
315 | items[i].desc = str(LANG_INFO); | ||
316 | items[i++].function = show_info; | ||
317 | |||
318 | items[i].desc = str(LANG_VERSION); | ||
319 | items[i++].function = show_credits; | ||
320 | |||
291 | #ifndef SIMULATOR | 321 | #ifndef SIMULATOR |
292 | { str(LANG_DEBUG), debug_menu }, | 322 | items[i].desc = str(LANG_DEBUG); |
323 | items[i++].function = debug_menu; | ||
293 | #else | 324 | #else |
294 | { str(LANG_USB), simulate_usb }, | 325 | items[i].desc = str(LANG_USB); |
326 | items[i++].function = simulate_usb; | ||
295 | #endif | 327 | #endif |
296 | }; | ||
297 | 328 | ||
298 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | 329 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); |
299 | #ifdef HAVE_LCD_CHARCELLS | 330 | #ifdef HAVE_LCD_CHARCELLS |
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index 0459ff3d74..ab0c1eb004 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c | |||
@@ -74,6 +74,18 @@ void radio_stop(void) | |||
74 | 74 | ||
75 | } | 75 | } |
76 | 76 | ||
77 | bool radio_hardware_present(void) | ||
78 | { | ||
79 | int val; | ||
80 | |||
81 | fmradio_set(2, 0x140885); /* 5kHz, 7.2MHz crystal, test mode 1 */ | ||
82 | val = fmradio_read(0); | ||
83 | if(val == 0x140885) | ||
84 | return true; | ||
85 | else | ||
86 | return false; | ||
87 | } | ||
88 | |||
77 | void radio_set_frequency(int freq) | 89 | void radio_set_frequency(int freq) |
78 | { | 90 | { |
79 | /* We add the standard Intermediate Frequency 10.7MHz before calculating | 91 | /* We add the standard Intermediate Frequency 10.7MHz before calculating |
diff --git a/apps/recorder/radio.h b/apps/recorder/radio.h index 45942a9990..5ddbf13d6b 100644 --- a/apps/recorder/radio.h +++ b/apps/recorder/radio.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifdef HAVE_FMRADIO | 22 | #ifdef HAVE_FMRADIO |
23 | bool radio_screen(void); | 23 | bool radio_screen(void); |
24 | void radio_stop(void); | 24 | void radio_stop(void); |
25 | bool radio_hardware_present(void); | ||
25 | 26 | ||
26 | struct fmstation | 27 | struct fmstation |
27 | { | 28 | { |