Fixed the FM preset menu button handling (again)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5308 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2004-10-19 09:09:27 +00:00
parent e88f8b1ffe
commit 4edbef5714

View file

@ -60,6 +60,8 @@
#define FM_FREEZE BUTTON_PLAY #define FM_FREEZE BUTTON_PLAY
#define FM_STOP BUTTON_OFF #define FM_STOP BUTTON_OFF
#define FM_EXIT (BUTTON_ON | BUTTON_REL) #define FM_EXIT (BUTTON_ON | BUTTON_REL)
#define FM_PRESET_ADD BUTTON_F1
#define FM_PRESET_ACTION BUTTON_F3
#elif CONFIG_KEYPAD == ONDIO_PAD /* restricted keypad */ #elif CONFIG_KEYPAD == ONDIO_PAD /* restricted keypad */
#define FM_MENU (BUTTON_MENU | BUTTON_REPEAT) #define FM_MENU (BUTTON_MENU | BUTTON_REPEAT)
#define FM_RECORD (BUTTON_MENU | BUTTON_REL) #define FM_RECORD (BUTTON_MENU | BUTTON_REL)
@ -669,12 +671,12 @@ static int handle_radio_presets_menu_cb(int key, int m)
#if CONFIG_KEYPAD == RECORDER_PAD #if CONFIG_KEYPAD == RECORDER_PAD
switch(key) switch(key)
{ {
case BUTTON_F3 | BUTTON_REL: case FM_PRESET_ACTION:
key = MENU_EXIT; /* Fake an exit */ key = MENU_EXIT; /* Fake an exit */
break; break;
case BUTTON_F3: case FM_PRESET_ACTION | BUTTON_REL:
/* Ignore the DOWN events */ /* Ignore the release events */
key = BUTTON_NONE; key = BUTTON_NONE;
break; break;
} }
@ -744,18 +746,18 @@ int handle_radio_presets_cb(int key, int m)
switch(key) switch(key)
{ {
case BUTTON_F1 | BUTTON_REL: case FM_PRESET_ADD:
radio_add_preset(); radio_add_preset();
menu_draw(m); menu_draw(m);
key = BUTTON_NONE; key = BUTTON_NONE;
break; break;
case BUTTON_F2 | BUTTON_REL: case FM_PRESET:
menu_draw(m); menu_draw(m);
key = MENU_EXIT; /* Fake an exit */ key = MENU_EXIT; /* Fake an exit */
break; break;
case BUTTON_F3 | BUTTON_REL: case FM_PRESET_ACTION:
ret = handle_radio_presets_menu(); ret = handle_radio_presets_menu();
menu_draw(m); menu_draw(m);
if(ret) if(ret)
@ -764,10 +766,9 @@ int handle_radio_presets_cb(int key, int m)
key = BUTTON_NONE; key = BUTTON_NONE;
break; break;
case BUTTON_F1: case FM_PRESET_ADD | BUTTON_REL:
case BUTTON_F2: case FM_PRESET_ACTION | BUTTON_REL:
case BUTTON_F3: /* Ignore the release events */
/* Ignore the DOWN events */
key = BUTTON_NONE; key = BUTTON_NONE;
break; break;
} }