summaryrefslogtreecommitdiff
path: root/firmware/drivers/button.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-05-15 21:02:47 +0000
committerThomas Martitz <kugel@rockbox.org>2010-05-15 21:02:47 +0000
commit3d0cee8abbaf764958743e8a7851eee94e60a913 (patch)
treea96b1ec825003a71643a7da4707c300f64824f82 /firmware/drivers/button.c
parentdcf442e61f21fb2aef5ce7de0547f733557b156e (diff)
downloadrockbox-3d0cee8abbaf764958743e8a7851eee94e60a913.zip
rockbox-3d0cee8abbaf764958743e8a7851eee94e60a913.tar.gz
rockbox-3d0cee8abbaf764958743e8a7851eee94e60a913.tar.bz2
rockbox-3d0cee8abbaf764958743e8a7851eee94e60a913.tar.xz
- Move uisimulator/sdl/*.[ch] into the target tree, under firmware/target/hosted/sdl, uisdl.c is split up across button-sdl.c and system-sdl.c.
- Refactor the program startup. main() is now in main.c like on target, and the implicit application thread will now act as our main thread (previously a separate one was created for this in thread initialization). This is part of Rockbox as an application and is the first step to make an application port from the uisimulator. In a further step the sim bits from the sdl build will be separated out. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26065 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/button.c')
-rw-r--r--firmware/drivers/button.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 100957b..f116ad6 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -429,7 +429,6 @@ void button_init(void)
tick_add_task(button_tick);
}
-#ifndef SIMULATOR
#ifdef BUTTON_DRIVER_CLOSE
void button_close(void)
{
@@ -443,9 +442,10 @@ void button_close(void)
*/
static int button_flip(int button)
{
- int newbutton;
+ int newbutton = button;
- newbutton = button &
+#ifndef SIMULATOR
+ newbutton &=
~(BUTTON_LEFT | BUTTON_RIGHT
#if defined(BUTTON_UP) && defined(BUTTON_DOWN)
| BUTTON_UP | BUTTON_DOWN
@@ -503,7 +503,7 @@ static int button_flip(int button)
if (button & BUTTON_PREV)
newbutton |= BUTTON_NEXT;
#endif
-
+#endif /* !SIMULATOR */
return newbutton;
}
@@ -523,7 +523,6 @@ void button_set_flip(bool flip)
}
}
#endif /* HAVE_LCD_FLIP */
-#endif /* SIMULATOR */
#ifdef HAVE_BACKLIGHT
void set_backlight_filter_keypress(bool value)