summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-09-12 11:03:14 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-09-12 11:03:14 +0000
commit7dec69dbced4d889930a96533908dc07e845721c (patch)
tree6332a5167860f2bc75d29a101b43ec6ed7651808 /firmware
parent829f00e68872209a8dc7a8ac9148fd99e851ae72 (diff)
downloadrockbox-7dec69dbced4d889930a96533908dc07e845721c.tar.gz
rockbox-7dec69dbced4d889930a96533908dc07e845721c.tar.bz2
rockbox-7dec69dbced4d889930a96533908dc07e845721c.zip
Safety net for devices with no hardware poweroff mechanism - hold STOP for several seconds to force a poweroff if the normal shutdown fails
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7512 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/button.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index b4ab7203a3..b0f8aa1e4d 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -131,7 +131,14 @@ static void button_tick(void)
!charger_inserted() &&
#endif
repeat_count > POWEROFF_COUNT)
+ {
queue_post(&button_queue, SYS_POWEROFF, NULL);
+
+ /* Safety net for players without hardware
+ poweroff */
+ if(repeat_count > POWEROFF_COUNT * 10)
+ power_off();
+ }
#endif
}
}