From 7dec69dbced4d889930a96533908dc07e845721c Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Mon, 12 Sep 2005 11:03:14 +0000 Subject: [PATCH] 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 --- firmware/drivers/button.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 } }