diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-09-12 11:03:14 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-09-12 11:03:14 +0000 |
| commit | 7dec69dbced4d889930a96533908dc07e845721c (patch) | |
| tree | 6332a5167860f2bc75d29a101b43ec6ed7651808 /firmware/drivers/button.c | |
| parent | 829f00e68872209a8dc7a8ac9148fd99e851ae72 (diff) | |
| download | rockbox-7dec69dbced4d889930a96533908dc07e845721c.zip rockbox-7dec69dbced4d889930a96533908dc07e845721c.tar.gz rockbox-7dec69dbced4d889930a96533908dc07e845721c.tar.bz2 rockbox-7dec69dbced4d889930a96533908dc07e845721c.tar.xz | |
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/drivers/button.c')
| -rw-r--r-- | firmware/drivers/button.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index b4ab720..b0f8aa1 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 } } |