From d1d752554b3976fd6f6956eb1ddcbd415a2260f6 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Wed, 26 Jun 2002 21:31:47 +0000 Subject: Bug 574204 fixed. Now reboots when OFF is pressed while charging. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1207 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/button.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index bd54dba523..7f680c6643 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -23,6 +23,7 @@ #include #include "config.h" #include "sh7034.h" +#include "system.h" #include "button.h" #include "kernel.h" #include "backlight.h" @@ -64,6 +65,14 @@ static void button_tick(void) post = true; repeat = true; count = REPEAT_INTERVAL; +#ifdef HAVE_RECORDER_KEYPAD + /* If the OFF button is pressed long enough, and we are + still alive, then the unit must be connected to a + charger. Therefore we will reboot and let the original + firmware handle the charging. */ + if(btn == BUTTON_OFF) + system_reboot(); +#endif } } if ( post ) -- cgit v1.2.3