Commit stable parts of FS#9611 - Sansa Clip radio code

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19813 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Bertrik Sikken 2009-01-21 20:51:43 +00:00
parent f1c6c3a754
commit ae351903a6
5 changed files with 23 additions and 14 deletions

View file

@ -218,12 +218,19 @@ static const struct button_mapping button_context_recscreen[] = {
/** FM Radio Screen **/
static const struct button_mapping button_context_radio[] = {
{ ACTION_FM_MENU, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_FM_PRESET, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
{ ACTION_FM_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
{ ACTION_FM_MODE, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
{ ACTION_FM_EXIT, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE },
{ ACTION_FM_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP },
/* Copied from keymap-c200.c 20081207. Feel free to suggest a better one.*/
{ ACTION_NONE, BUTTON_UP, BUTTON_NONE },
{ 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_HOME, BUTTON_NONE },
{ ACTION_FM_EXIT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
{ ACTION_FM_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP },
{ ACTION_SETTINGS_INC, BUTTON_VOL_UP, BUTTON_NONE },
{ ACTION_SETTINGS_INCREPEAT,BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_VOL_DOWN, BUTTON_NONE },
{ ACTION_SETTINGS_DECREPEAT,BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
}; /* button_context_radio */

View file

@ -20,13 +20,12 @@
#define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */
#define REC_SAMPR_DEFAULT SAMPR_22
#endif
/* Define bitmask of input sources - recordable bitmask can be defined
explicitly if different */
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO)
#endif
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
@ -106,10 +105,8 @@
#define AB_REPEAT_ENABLE 1
/* FM Tuner */
#if 0 /* disabled since there is no driver (yet) */
#define CONFIG_TUNER SI4700 /* in fact SI4702 but let's hope it's compatible */
//#define HAVE_TUNER_PWR_CTRL
#endif
/* Define this for LCD backlight available */
#define HAVE_BACKLIGHT

View file

@ -17,10 +17,10 @@
#define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */
#define REC_SAMPR_DEFAULT SAMPR_22
#endif
/* Define bitmask of input sources - recordable bitmask can be defined
explicitly if different */
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO)
#endif
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
@ -99,7 +99,7 @@
#define AB_REPEAT_ENABLE 1
/* FM Tuner - suspected to be the SI4702 */
//#define CONFIG_TUNER SI4700
#define CONFIG_TUNER SI4700
/* #define HAVE_TUNER_PWR_CTRL */
/* Define this for LCD backlight available */

View file

@ -19,8 +19,8 @@
/* Define bitmask of input sources - recordable bitmask can be defined
explicitly if different */
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO)
#endif
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO)
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
@ -99,7 +99,7 @@
#define AB_REPEAT_ENABLE 1
/* FM Tuner - suspected to be the SI4702 */
//#define CONFIG_TUNER SI4700
#define CONFIG_TUNER SI4700
/* #define HAVE_TUNER_PWR_CTRL */
/* Define this for LCD backlight available */

View file

@ -26,6 +26,7 @@
#include "ascodec-target.h"
#include "dma-target.h"
#include "clock-target.h"
#include "fmradio_i2c.h"
#define default_interrupt(name) \
extern __attribute__((weak,alias("UIRQ"))) void name (void)
@ -263,6 +264,10 @@ void system_init(void)
* We don't need the power button in the bootloader. */
ascodec_init();
ascodec_write(AS3514_CVDD_DCDC3, ascodec_read(AS3514_CVDD_DCDC3) & (1<<2));
#ifdef CONFIG_TUNER
fmradio_i2c_init();
#endif
#endif /* !BOOTLOADER */
#ifdef HAVE_ADJUSTABLE_CPU_FREQ