diff options
| author | Tomer Shalev <shalev.tomer@gmail.com> | 2009-10-05 17:53:45 +0000 |
|---|---|---|
| committer | Tomer Shalev <shalev.tomer@gmail.com> | 2009-10-05 17:53:45 +0000 |
| commit | a39be4b3073ef32a3e33bdbf88f0c1474c7b1931 (patch) | |
| tree | 1f933f70ab0fc45a1aa8b1e95fb24969bd7d5b20 /firmware/drivers/button.c | |
| parent | f7bd7252e14a151217f1a9b7eee6200eb23586a8 (diff) | |
| download | rockbox-a39be4b3073ef32a3e33bdbf88f0c1474c7b1931.zip rockbox-a39be4b3073ef32a3e33bdbf88f0c1474c7b1931.tar.gz rockbox-a39be4b3073ef32a3e33bdbf88f0c1474c7b1931.tar.bz2 rockbox-a39be4b3073ef32a3e33bdbf88f0c1474c7b1931.tar.xz | |
Fix red: Invert buttons in RTL mode
- Revert renaming of button_set_flip()
- Moved rtl flipping logic to apps/actions.c as a static function
- Joined rtl_button_flip_needed() and button_flip_horizontally()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22962 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/button.c')
| -rw-r--r-- | firmware/drivers/button.c | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 7f37087..71cd472 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -437,7 +437,7 @@ void button_close(void) /* * helper function to swap LEFT/RIGHT, UP/DOWN (if present), and F1/F3 (Recorder) */ -static int button_flip_vertically(int button) +static int button_flip(int button) { int newbutton; @@ -507,49 +507,19 @@ static int button_flip_vertically(int button) * set the flip attribute * better only call this when the queue is empty */ -void button_set_flip_vertically(bool flip) +void button_set_flip(bool flip) { if (flip != flipped) /* not the current setting */ { /* avoid race condition with the button_tick() */ int oldlevel = disable_irq_save(); - lastbtn = button_flip_vertically(lastbtn); + lastbtn = button_flip(lastbtn); flipped = flip; restore_irq(oldlevel); } } #endif /* HAVE_LCD_FLIP */ -#if defined(HAVE_LCD_BITMAP) && !defined(BOOTLOADER) -/* - * helper function to swap LEFT/RIGHT sides (for RTL mode) - */ -int button_flip_horizontally(int button) -{ - int newbutton; - - newbutton = button & - ~(BUTTON_LEFT | BUTTON_RIGHT -#if defined(BUTTON_SCROLL_BACK) && defined(BUTTON_SCROLL_FWD) - | BUTTON_SCROLL_BACK | BUTTON_SCROLL_FWD -#endif - ); - - if (button & BUTTON_LEFT) - newbutton |= BUTTON_RIGHT; - if (button & BUTTON_RIGHT) - newbutton |= BUTTON_LEFT; -#if defined(BUTTON_SCROLL_BACK) && defined(BUTTON_SCROLL_FWD) - if (button & BUTTON_SCROLL_BACK) - newbutton |= BUTTON_SCROLL_FWD; - if (button & BUTTON_SCROLL_FWD) - newbutton |= BUTTON_SCROLL_BACK; -#endif - - return newbutton; -} -#endif - #ifdef HAVE_BACKLIGHT void set_backlight_filter_keypress(bool value) { @@ -580,7 +550,7 @@ static int button_read(void) #ifdef HAVE_LCD_FLIP if (btn && flipped) - btn = button_flip_vertically(btn); /* swap upside down */ + btn = button_flip(btn); /* swap upside down */ #endif /* HAVE_LCD_FLIP */ #ifdef HAVE_TOUCHSCREEN |