diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2009-10-05 02:09:00 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2009-10-05 02:09:00 +0000 |
commit | fb50f468666958564656386b7181a4973e042ebc (patch) | |
tree | 41aa7fc0b690d2690acf281ce3094d1de10c54fb /firmware/drivers | |
parent | 436776ebb8645f4393bafd01856d7ba2abe83356 (diff) |
Button Driver: Add button_status support with data - allows for reading the /immediate/ value of the touchscreen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22933 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/button.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index cc8a1b561a..6e30cb116d 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -86,6 +86,7 @@ static int button_read(void); #ifdef HAVE_TOUCHSCREEN static int last_touchscreen_touch; +static int lastdata = 0; #endif #if defined(HAVE_HEADPHONE_DETECTION) static struct timeout hp_detect_timeout; /* Debouncer for headphone plug/unplug */ @@ -304,6 +305,7 @@ static void button_tick(void) } } lastbtn = btn & ~(BUTTON_REL | BUTTON_REPEAT); + lastdata = data; } #ifdef HAVE_ADJUSTABLE_CPU_FREQ @@ -575,6 +577,14 @@ int button_status(void) return lastbtn; } +#ifdef HAVE_BUTTON_DATA +int button_status_wdata(int *pdata) +{ + *pdata = lastdata; + return lastbtn; +} +#endif + void button_clear_queue(void) { queue_clear(&button_queue); |