diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2007-06-06 19:23:48 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2007-06-06 19:23:48 +0000 |
commit | 21a4a87ca2553834b3f7b0c8f95f1b0889d8cb2c (patch) | |
tree | b3c7693a1c1b2e24d5aeee3e3316bbcc404f7dbc /apps | |
parent | af4cd0a84cc8ead0e3b9c32684c55235c792fb12 (diff) | |
download | rockbox-21a4a87ca2553834b3f7b0c8f95f1b0889d8cb2c.tar.gz rockbox-21a4a87ca2553834b3f7b0c8f95f1b0889d8cb2c.zip |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/debug_menu.c | 34 | ||||
-rw-r--r-- | apps/keymaps/keymap-e200.c | 15 | ||||
-rw-r--r-- | apps/recorder/radio.c | 34 |
3 files changed, 77 insertions, 6 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 2279a27c13..32ab46cbda 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -1990,16 +1990,48 @@ static bool dbg_fm_radio(void) lcd_setmargins(0, 0); + fm_detected = radio_hardware_present(); + while(1) { int row = 0; lcd_clear_display(); - fm_detected = radio_hardware_present(); snprintf(buf, sizeof buf, "HW detected: %s", fm_detected?"yes":"no"); lcd_puts(0, row++, buf); +#if (CONFIG_TUNER & LV24020LP) + if (fm_detected) + { + snprintf(buf, sizeof buf, "CTRL_STAT: %02X", + sanyo_get(RADIO_ALL) ); + lcd_puts(0, row++, buf); + + snprintf(buf, sizeof buf, "RADIO_STAT: %02X", + sanyo_get(RADIO_REG_STAT)); + lcd_puts(0, row++, buf); + + snprintf(buf, sizeof buf, "MSS_FM: %d kHz", + (sanyo_get(RADIO_MSS_FM) ) ); + lcd_puts(0, row++, buf); + + snprintf(buf, sizeof buf, "MSS_IF: %d Hz", + (sanyo_get(RADIO_MSS_IF) ) ); + lcd_puts(0, row++, buf); + + snprintf(buf, sizeof buf, "MSS_SD: %d Hz", + (sanyo_get(RADIO_MSS_SD) ) ); + lcd_puts(0, row++, buf); + + snprintf(buf, sizeof buf, "if_set: %d Hz", + (sanyo_get(RADIO_IF_SET) ) ); + lcd_puts(0, row++, buf); + snprintf(buf, sizeof buf, "sd_set: %d Hz", + (sanyo_get(RADIO_SD_SET) ) ); + lcd_puts(0, row++, buf); + } +#endif #if (CONFIG_TUNER & S1A0903X01) snprintf(buf, sizeof buf, "Samsung regs: %08X", samsung_get(RADIO_ALL)); diff --git a/apps/keymaps/keymap-e200.c b/apps/keymaps/keymap-e200.c index 55e30ca258..318f495abe 100644 --- a/apps/keymaps/keymap-e200.c +++ b/apps/keymaps/keymap-e200.c @@ -219,6 +219,17 @@ static const struct button_mapping button_context_recscreen[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) }; /* button_context_recscreen */ +/** FM Radio Screen **/ +static const struct button_mapping button_context_radio[] = { + { ACTION_FM_MENU, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_FM_PRESET, BUTTON_SELECT, BUTTON_NONE }, + { ACTION_FM_STOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP }, + { ACTION_FM_MODE, BUTTON_REC, BUTTON_NONE }, + { ACTION_FM_EXIT, BUTTON_POWER, BUTTON_NONE }, + { ACTION_FM_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) +}; /* button_context_radio */ + static const struct button_mapping button_context_keyboard[] = { { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE }, { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, @@ -283,7 +294,9 @@ const struct button_mapping* get_context_mapping(int context) return button_context_settings_time; case CONTEXT_YESNOSCREEN: - return button_context_yesno; + return button_context_yesno; + case CONTEXT_FM: + return button_context_radio; case CONTEXT_BOOKMARKSCREEN: return button_context_bmark; case CONTEXT_QUICKSCREEN: 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); |