diff --git a/apps/SOURCES b/apps/SOURCES index 95e3479341..c186614733 100644 --- a/apps/SOURCES +++ b/apps/SOURCES @@ -72,7 +72,7 @@ recorder/backdrop.c gui/color_picker.c #endif #endif -#ifdef CONFIG_TUNER +#if CONFIG_TUNER recorder/radio.c #endif #ifdef HAVE_RECORDING diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 95b9aa8f01..9d449d78b9 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -60,7 +60,7 @@ #ifdef HAVE_MMC #include "ata_mmc.h" #endif -#ifdef CONFIG_TUNER +#if CONFIG_TUNER #include "tuner.h" #include "radio.h" #endif @@ -1986,7 +1986,7 @@ static bool dbg_save_roms(void) #endif /* CPU */ #ifndef SIMULATOR -#ifdef CONFIG_TUNER +#if CONFIG_TUNER static bool dbg_fm_radio(void) { char buf[32]; @@ -2357,7 +2357,7 @@ bool debug_menu(void) #endif /* PM_DEBUG */ #endif /* HAVE_LCD_BITMAP */ #ifndef SIMULATOR -#ifdef CONFIG_TUNER +#if CONFIG_TUNER { "FM Radio", dbg_fm_radio }, #endif #endif diff --git a/apps/filetree.c b/apps/filetree.c index df4065c91b..edf4fa0b63 100644 --- a/apps/filetree.c +++ b/apps/filetree.c @@ -46,7 +46,7 @@ #include "keyboard.h" #endif -#ifdef CONFIG_TUNER +#if CONFIG_TUNER #include "radio.h" #endif @@ -288,7 +288,7 @@ int ft_load(struct tree_context* c, const char* tempdir) #ifdef HAVE_REMOTE_LCD (*c->dirfilter == SHOW_RWPS && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_RWPS) || #endif -#ifdef CONFIG_TUNER +#if CONFIG_TUNER (*c->dirfilter == SHOW_FMR && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_FMR) || #endif (*c->dirfilter == SHOW_CFG && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_CFG) || @@ -435,7 +435,7 @@ int ft_enter(struct tree_context* c) } break; -#ifdef CONFIG_TUNER +#if CONFIG_TUNER /* fmr preset file */ case TREE_ATTR_FMR: diff --git a/apps/main.c b/apps/main.c index 9f521e5064..70a3f8ddea 100644 --- a/apps/main.c +++ b/apps/main.c @@ -84,7 +84,7 @@ #define SETTINGS_RESET BUTTON_REC #endif -#ifdef CONFIG_TUNER +#if CONFIG_TUNER #include "radio.h" #endif #ifdef HAVE_MMC @@ -364,7 +364,7 @@ static void init(void) audio_preinit(); #endif -#ifdef CONFIG_TUNER +#if CONFIG_TUNER radio_init(); #endif diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 52d4d6116a..9a618e2e33 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c @@ -30,7 +30,7 @@ #include "settings_menu.h" #include "exported_menus.h" #include "tree.h" -#ifdef CONFIG_TUNER +#if CONFIG_TUNER #include "radio.h" #endif #ifdef HAVE_RECORDING @@ -386,7 +386,7 @@ MENUITEM_FUNCTION_WPARAM(browse_themes, ID2P(LANG_CUSTOM_THEME), MENUITEM_FUNCTION_WPARAM(browse_plugins, ID2P(LANG_PLUGINS), browse_folder, (void*)&rocks, NULL, bitmap_icons_6x8[Icon_Plugin]); -#ifdef CONFIG_TUNER +#if CONFIG_TUNER MENUITEM_FUNCTION(load_radio_screen, ID2P(LANG_FM_RADIO), (menu_function)radio_screen, dynamicitem_callback, bitmap_icons_6x8[Icon_Radio_screen]); @@ -428,7 +428,7 @@ MAKE_MENU(main_menu_, "Rockbox Main Menu", mainmenu_callback, bitmap_icons_6x8[Icon_Submenu_Entered], &mrb_bookmarks, &sound_settings, &settings_menu_item, &manage_settings, &browse_themes, -#ifdef CONFIG_TUNER +#if CONFIG_TUNER &load_radio_screen, #endif #ifdef HAVE_RECORDING @@ -449,7 +449,7 @@ int dynamicitem_callback(int action,const struct menu_item_ex *this_item) if (action != ACTION_ENTER_MENUITEM) return action; -#ifdef CONFIG_TUNER +#if CONFIG_TUNER if (this_item == &load_radio_screen) { if (radio_hardware_present() == 0) diff --git a/apps/status.c b/apps/status.c index 3f46607ed1..1551f77d53 100644 --- a/apps/status.c +++ b/apps/status.c @@ -43,7 +43,7 @@ #include "button.h" #endif #include "usb.h" -#ifdef CONFIG_TUNER +#if CONFIG_TUNER #include "radio.h" #endif #if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC @@ -96,7 +96,7 @@ int current_playmode(void) } #endif -#ifdef CONFIG_TUNER +#if CONFIG_TUNER audio_stat = get_radio_status(); if(audio_stat & FMRADIO_PLAYING) return STATUS_RADIO; diff --git a/firmware/SOURCES b/firmware/SOURCES index 9842689544..d8dd65e635 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -145,7 +145,7 @@ drivers/rtc/rtc_as3514.c #endif /* SIMULATOR */ /* Tuner */ -#ifdef CONFIG_TUNER +#if CONFIG_TUNER #ifndef SIMULATOR #if (CONFIG_TUNER & S1A0903X01) drivers/fmradio.c diff --git a/firmware/export/config.h b/firmware/export/config.h index b9420122e0..8519628d47 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -216,6 +216,12 @@ /* no known platform */ #endif +/* now set any CONFIG_ defines correctly if they are not used, + No need to do this on CONFIG_'s which are compulsary (e.g CONFIG_CODEC ) */ +#ifndef CONFIG_TUNER +#define CONFIG_TUNER 0 +#endif + /* Enable the directory cache and tagcache in RAM if we have * plenty of RAM. Both features can be enabled independently. */ #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \ diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 1b160af232..88fc5e8e33 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c @@ -37,7 +37,7 @@ #include "backlight.h" #include "lcd.h" #include "rtc.h" -#ifdef CONFIG_TUNER +#if CONFIG_TUNER #include "fmradio.h" #endif #ifdef HAVE_UDA1380 @@ -634,7 +634,7 @@ static void handle_auto_poweroff(void) #endif if(timeout && -#if defined(CONFIG_TUNER) && !defined(BOOTLOADER) +#if CONFIG_TUNER && !defined(BOOTLOADER) (!(get_radio_status() & FMRADIO_PLAYING)) && #endif !usb_inserted() &&