diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-09-23 11:33:04 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-09-23 11:33:04 +0000 |
| commit | 2aee04366f2992a4a69d8a3d20f880d52a849cba (patch) | |
| tree | d2ad39ac334493bd9d95849ccd655dce664d6898 /firmware | |
| parent | d4e2ee56ef61b123b01cfed288a9ab387443d44a (diff) | |
| download | rockbox-2aee04366f2992a4a69d8a3d20f880d52a849cba.zip rockbox-2aee04366f2992a4a69d8a3d20f880d52a849cba.tar.gz rockbox-2aee04366f2992a4a69d8a3d20f880d52a849cba.tar.bz2 rockbox-2aee04366f2992a4a69d8a3d20f880d52a849cba.tar.xz | |
Added timestamps of key presses, for auto-poweroff
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2372 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
| -rw-r--r-- | firmware/drivers/button.c | 6 | ||||
| -rw-r--r-- | firmware/drivers/button.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index a0a43d2..d6a2151 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -31,6 +31,8 @@ struct event_queue button_queue; +long last_keypress; + /* how often we check to see if a button is pressed */ #define POLL_FREQUENCY HZ/20 @@ -140,6 +142,8 @@ static void button_tick(void) else queue_post(&button_queue, btn, NULL); backlight_on(); + + last_keypress = current_tick; } } else @@ -291,6 +295,8 @@ void button_init(void) PAIOR &= ~0x820; queue_init(&button_queue); tick_add_task(button_tick); + + last_keypress = current_tick; } static int button_read(void) diff --git a/firmware/drivers/button.h b/firmware/drivers/button.h index 6563f1b..fc1d8f3 100644 --- a/firmware/drivers/button.h +++ b/firmware/drivers/button.h @@ -23,6 +23,7 @@ #include "config.h" extern struct event_queue button_queue; +extern long last_keypress; void button_init (void); int button_get (bool block); |