diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-04-23 09:21:37 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-04-23 09:21:37 +0000 |
commit | 28cce684a3f433200e5257eb929ee8d7a63b67ff (patch) | |
tree | 6afe48a8bd53bac805e6ae19dd58f6843af5ccf1 /firmware | |
parent | 86587527f52db8320f8d8ea48dfc76d3d93d79c8 (diff) |
Changed remote control button events to separate codes. Now the remote control works while keys are locked.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3586 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/serial.c | 16 | ||||
-rw-r--r-- | firmware/export/button.h | 22 |
2 files changed, 15 insertions, 23 deletions
diff --git a/firmware/drivers/serial.c b/firmware/drivers/serial.c index 982b99fc2c..5ea807abb4 100644 --- a/firmware/drivers/serial.c +++ b/firmware/drivers/serial.c @@ -91,31 +91,27 @@ int remote_control_rx(void) switch (btn) { case STOP: -#ifdef HAVE_RECORDER_KEYPAD - last_valid_button = BUTTON_OFF; -#else - last_valid_button = BUTTON_STOP; -#endif + last_valid_button = BUTTON_RC_STOP; break; case PLAY: - last_valid_button = BUTTON_PLAY; + last_valid_button = BUTTON_RC_PLAY; break; case VOLUP: - last_valid_button = BUTTON_VOL_UP; + last_valid_button = BUTTON_RC_VOL_UP; break; case VOLDN: - last_valid_button = BUTTON_VOL_DOWN; + last_valid_button = BUTTON_RC_VOL_DOWN; break; case PREV: - last_valid_button = BUTTON_LEFT; + last_valid_button = BUTTON_RC_LEFT; break; case NEXT: - last_valid_button = BUTTON_RIGHT; + last_valid_button = BUTTON_RC_RIGHT; break; #ifdef SCREENDUMP diff --git a/firmware/export/button.h b/firmware/export/button.h index c980e2e36c..e3c37f9382 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h @@ -1,3 +1,4 @@ + /*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ @@ -37,16 +38,18 @@ int button_get_w_tmo(int ticks); #define BUTTON_LEFT 0x0040 #define BUTTON_RIGHT 0x0080 -/* remote control buttons */ -#define BUTTON_VOL_UP 0x1000 -#define BUTTON_VOL_DOWN 0x1001 - /* Button modifiers */ +#define BUTTON_REMOTE 0x2000 #define BUTTON_REPEAT 0x4000 #define BUTTON_REL 0x8000 -/* Special message */ -#define BUTTON_LOCKED 0x2000 +/* remote control buttons */ +#define BUTTON_RC_VOL_UP (0x0008 | BUTTON_REMOTE) +#define BUTTON_RC_VOL_DOWN (0x0800 | BUTTON_REMOTE) +#define BUTTON_RC_PLAY (BUTTON_UP | BUTTON_REMOTE) +#define BUTTON_RC_STOP (BUTTON_DOWN | BUTTON_REMOTE) +#define BUTTON_RC_LEFT (BUTTON_LEFT | BUTTON_REMOTE) +#define BUTTON_RC_RIGHT (BUTTON_RIGHT| BUTTON_REMOTE) #ifdef HAVE_RECORDER_KEYPAD @@ -57,10 +60,6 @@ int button_get_w_tmo(int ticks); #define BUTTON_F2 0x0200 #define BUTTON_F3 0x0400 -#define ALL_BUTTONS (BUTTON_ON | BUTTON_UP | BUTTON_DOWN | BUTTON_LEFT | \ - BUTTON_RIGHT | BUTTON_OFF | BUTTON_PLAY | BUTTON_F1 | \ - BUTTON_F2 | BUTTON_F3) - #elif HAVE_PLAYER_KEYPAD /* Jukebox 6000 and Studio specific button codes */ @@ -68,9 +67,6 @@ int button_get_w_tmo(int ticks); #define BUTTON_PLAY BUTTON_UP #define BUTTON_STOP BUTTON_DOWN -#define ALL_BUTTONS (BUTTON_ON | BUTTON_UP | BUTTON_DOWN | BUTTON_LEFT | \ - BUTTON_RIGHT | BUTTON_MENU) - #endif /* HAVE_PLAYER_KEYPAD */ #endif |