diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-10-16 12:40:30 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-10-16 12:40:30 +0000 |
commit | 7ec35e782803708cc69871fd9495ea80c846ff68 (patch) | |
tree | a9bfb6c08019fe3168cc22e87599635bd8dd408f /firmware/drivers | |
parent | 67c977fe0d5bb92a39b5eba4e1c0cee175ecbc99 (diff) | |
download | rockbox-7ec35e782803708cc69871fd9495ea80c846ff68.tar.gz rockbox-7ec35e782803708cc69871fd9495ea80c846ff68.zip |
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')
-rw-r--r-- | firmware/drivers/button.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 4657e1d84b..e70246314d 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "backlight.h" | 29 | #include "backlight.h" |
30 | #include "adc.h" | 30 | #include "adc.h" |
31 | #include "serial.h" | 31 | #include "serial.h" |
32 | #include "power.h" | ||
32 | 33 | ||
33 | struct event_queue button_queue; | 34 | struct event_queue button_queue; |
34 | 35 | ||
@@ -127,15 +128,12 @@ static void button_tick(void) | |||
127 | /* initial repeat */ | 128 | /* initial repeat */ |
128 | count = REPEAT_INTERVAL_START; | 129 | count = REPEAT_INTERVAL_START; |
129 | } | 130 | } |
130 | /* If the OFF button is pressed long enough, | 131 | /* Reboot if the OFF button is pressed long enough |
131 | and we are still alive, then the unit must be | 132 | and we are connected to a charger. */ |
132 | connected to a charger. Therefore we will | ||
133 | reboot and let the original firmware handle | ||
134 | the charging. */ | ||
135 | #ifdef HAVE_RECORDER_KEYPAD | 133 | #ifdef HAVE_RECORDER_KEYPAD |
136 | if(btn == BUTTON_OFF) | 134 | if(btn == BUTTON_OFF && charger_inserted()) |
137 | #elif HAVE_PLAYER_KEYPAD | 135 | #elif HAVE_PLAYER_KEYPAD |
138 | if(btn == BUTTON_STOP) | 136 | if(btn == BUTTON_STOP && charger_inserted()) |
139 | #endif | 137 | #endif |
140 | system_reboot(); | 138 | system_reboot(); |
141 | } | 139 | } |