From 0b3ea1bfcba0e56e72cacfcb88944dcf2e3b3a07 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 12 Oct 2004 11:00:19 +0000 Subject: Now the FM, V2 and Ondio players use the new SYS_POWEROFF event. Now you can safely turn off the player by holding OFF. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5259 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/button.c | 11 ++++++----- firmware/export/config-fmrecorder.h | 3 +++ firmware/export/config-ondiofm.h | 3 +++ firmware/export/config-ondiosp.h | 3 +++ 4 files changed, 15 insertions(+), 5 deletions(-) (limited to 'firmware') diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 607e72e09a..0cfe1d1aa0 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -54,7 +54,7 @@ static bool flipped; /* bottons can be flipped to match the LCD flip */ #define REPEAT_INTERVAL_FINISH 5 /* Number of repeated keys before shutting off */ -#define POWEROFF_COUNT 40 +#define POWEROFF_COUNT 10 static int button_read(void); @@ -116,12 +116,13 @@ static void button_tick(void) repeat_count++; - /* Shutdown if we have a device which doesn't shut - down easily with the OFF key */ -#ifdef HAVE_POWEROFF_ON_PB5 + /* Send a SYS_POWEROFF event if we have a device + which doesn't shut down easily with the OFF + key */ +#ifdef HAVE_SW_POWEROFF if(btn == BUTTON_OFF && !charger_inserted() && repeat_count > POWEROFF_COUNT) - power_off(); + queue_post(&button_queue, SYS_POWEROFF, NULL); #endif } } diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h index aec31c2b84..0903e66c6d 100644 --- a/firmware/export/config-fmrecorder.h +++ b/firmware/export/config-fmrecorder.h @@ -73,4 +73,7 @@ /* Define this for LCD backlight available */ #define HAVE_BACKLIGHT +/* Define this if you have a software controlled poweroff */ +#define HAVE_SW_POWEROFF + #endif /* SIMULATOR */ diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h index f7cff94f5e..437f8682a8 100644 --- a/firmware/export/config-ondiofm.h +++ b/firmware/export/config-ondiofm.h @@ -70,4 +70,7 @@ /* Define this if the MAS SIBI line can be controlled via PB8 */ #define HAVE_MAS_SIBI_CONTROL +/* Define this if you have a software controlled poweroff */ +#define HAVE_SW_POWEROFF + #endif /* SIMULATOR */ diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h index 111787ffc9..9bf29f17a5 100644 --- a/firmware/export/config-ondiosp.h +++ b/firmware/export/config-ondiosp.h @@ -64,4 +64,7 @@ /* Define this if the MAS SIBI line can be controlled via PB8 */ #define HAVE_MAS_SIBI_CONTROL +/* Define this if you have a software controlled poweroff */ +#define HAVE_SW_POWEROFF + #endif /* SIMULATOR */ -- cgit v1.2.3