summaryrefslogtreecommitdiff
path: root/firmware/drivers/button.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-10-16 12:40:30 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-10-16 12:40:30 +0000
commit7ec35e782803708cc69871fd9495ea80c846ff68 (patch)
treea9bfb6c08019fe3168cc22e87599635bd8dd408f /firmware/drivers/button.c
parent67c977fe0d5bb92a39b5eba4e1c0cee175ecbc99 (diff)
downloadrockbox-7ec35e782803708cc69871fd9495ea80c846ff68.zip
rockbox-7ec35e782803708cc69871fd9495ea80c846ff68.tar.gz
rockbox-7ec35e782803708cc69871fd9495ea80c846ff68.tar.bz2
rockbox-7ec35e782803708cc69871fd9495ea80c846ff68.tar.xz
Don't reboot unless we are connected to a charger
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2683 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/button.c')
-rw-r--r--firmware/drivers/button.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 4657e1d..e702463 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -29,6 +29,7 @@
#include "backlight.h"
#include "adc.h"
#include "serial.h"
+#include "power.h"
struct event_queue button_queue;
@@ -127,15 +128,12 @@ static void button_tick(void)
/* initial repeat */
count = REPEAT_INTERVAL_START;
}
- /* 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. */
+ /* Reboot if the OFF button is pressed long enough
+ and we are connected to a charger. */
#ifdef HAVE_RECORDER_KEYPAD
- if(btn == BUTTON_OFF)
+ if(btn == BUTTON_OFF && charger_inserted())
#elif HAVE_PLAYER_KEYPAD
- if(btn == BUTTON_STOP)
+ if(btn == BUTTON_STOP && charger_inserted())
#endif
system_reboot();
}