summaryrefslogtreecommitdiff
path: root/firmware/drivers/button.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-09-23 11:33:04 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-09-23 11:33:04 +0000
commit2aee04366f2992a4a69d8a3d20f880d52a849cba (patch)
treed2ad39ac334493bd9d95849ccd655dce664d6898 /firmware/drivers/button.c
parentd4e2ee56ef61b123b01cfed288a9ab387443d44a (diff)
downloadrockbox-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/drivers/button.c')
-rw-r--r--firmware/drivers/button.c6
1 files changed, 6 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)