From 21a4a87ca2553834b3f7b0c8f95f1b0889d8cb2c Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 6 Jun 2007 19:23:48 +0000 Subject: Accept FS#7178 - Sansa e200 FM tuner support by Ivan Zupan. Do the needed integration work into recording and the AS3514 audio driver. Do a little AS3514 fiq_record tweak to have it all work nicely from the start. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13573 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/radio.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'apps/recorder/radio.c') diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index a0e6c81e3a..9f3228be1f 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c @@ -90,6 +90,13 @@ #elif CONFIG_KEYPAD == ONDIO_PAD #define FM_RECORD_DBLPRE #define FM_RECORD +#elif (CONFIG_KEYPAD == SANSA_E200_PAD) +#define FM_MENU +#define FM_PRESET +#define FM_STOP +#define FM_MODE +#define FM_EXIT +#define FM_PLAY #endif #define RADIO_SCAN_MODE 0 @@ -97,10 +104,14 @@ static const struct fm_region_setting fm_region[] = { /* Note: Desriptive strings are just for display atm and are not compiled. */ - FM_REGION_ENTRY("Europe", 87500000, 108000000, 50000, 0, 0), - FM_REGION_ENTRY("US/Canada", 87900000, 107900000, 200000, 1, 0), - FM_REGION_ENTRY("Japan", 76000000, 90000000, 100000, 0, 1), - FM_REGION_ENTRY("Korea", 87500000, 108000000, 100000, 0, 0), + [REGION_EUROPE] = + FM_REGION_ENTRY("Europe", 87500000, 108000000, 50000, 0, 0), + [REGION_US_CANADA] = + FM_REGION_ENTRY("US/Canada", 87900000, 107900000, 200000, 1, 0), + [REGION_JAPAN] = + FM_REGION_ENTRY("Japan", 76000000, 90000000, 100000, 0, 1), + [REGION_KOREA] = + FM_REGION_ENTRY("Korea", 87500000, 108000000, 100000, 0, 0), }; static int curr_preset = -1; @@ -158,13 +169,18 @@ bool in_radio_screen(void) return in_screen; } +/* TODO: Move some more of the control functionality to an HAL and clean up the + mess */ + /* secret flag for starting paused - prevents unmute */ #define FMRADIO_START_PAUSED 0x8000 void radio_start(void) { const struct fm_region_setting *fmr; bool start_paused; +#if CONFIG_TUNER != LV24020LP int mute_timeout; +#endif if(radio_status == FMRADIO_PLAYING) return; @@ -182,8 +198,14 @@ void radio_start(void) * fmr->freq_step + fmr->freq_min; radio_set(RADIO_SLEEP, 0); /* wake up the tuner */ +#if (CONFIG_TUNER & LV24020LP) + radio_set(RADIO_REGION, global_settings.fm_region); + radio_set(RADIO_FORCE_MONO, global_settings.fm_force_mono); +#endif radio_set(RADIO_FREQUENCY, curr_freq); +#if CONFIG_TUNER != LV24020LP + if(radio_status == FMRADIO_OFF) { #if (CONFIG_TUNER & S1A0903X01) @@ -209,6 +231,7 @@ void radio_start(void) break; yield(); } +#endif /* CONFIG_TUNER != LV24020LP */ /* keep radio from sounding initially */ if(!start_paused) @@ -1311,6 +1334,9 @@ void toggle_mono_mode(bool mono) void set_radio_region(int region) { +#if (CONFIG_TUNER & LV24020LP) + radio_set(RADIO_REGION, global_settings.fm_region); +#endif #if (CONFIG_TUNER & TEA5767) radio_set(RADIO_SET_DEEMPHASIS, fm_region[region].deemphasis); -- cgit v1.2.3