summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-10-12 11:00:19 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-10-12 11:00:19 +0000
commit0b3ea1bfcba0e56e72cacfcb88944dcf2e3b3a07 (patch)
tree70627c231bc98f806bfd0fb7e7b1af58432df819 /firmware/drivers
parent2e9412025b2f84b86a855c05beb748bc2e585525 (diff)
downloadrockbox-0b3ea1bfcba0e56e72cacfcb88944dcf2e3b3a07.tar.gz
rockbox-0b3ea1bfcba0e56e72cacfcb88944dcf2e3b3a07.zip
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
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/button.c11
1 files changed, 6 insertions, 5 deletions
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 */
54#define REPEAT_INTERVAL_FINISH 5 54#define REPEAT_INTERVAL_FINISH 5
55 55
56/* Number of repeated keys before shutting off */ 56/* Number of repeated keys before shutting off */
57#define POWEROFF_COUNT 40 57#define POWEROFF_COUNT 10
58 58
59static int button_read(void); 59static int button_read(void);
60 60
@@ -116,12 +116,13 @@ static void button_tick(void)
116 116
117 repeat_count++; 117 repeat_count++;
118 118
119 /* Shutdown if we have a device which doesn't shut 119 /* Send a SYS_POWEROFF event if we have a device
120 down easily with the OFF key */ 120 which doesn't shut down easily with the OFF
121#ifdef HAVE_POWEROFF_ON_PB5 121 key */
122#ifdef HAVE_SW_POWEROFF
122 if(btn == BUTTON_OFF && !charger_inserted() && 123 if(btn == BUTTON_OFF && !charger_inserted() &&
123 repeat_count > POWEROFF_COUNT) 124 repeat_count > POWEROFF_COUNT)
124 power_off(); 125 queue_post(&button_queue, SYS_POWEROFF, NULL);
125#endif 126#endif
126 } 127 }
127 } 128 }