diff options
Diffstat (limited to 'firmware/drivers/button.c')
-rw-r--r-- | firmware/drivers/button.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 718fb6a6da..d47a486b43 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c | |||
@@ -215,6 +215,27 @@ static void button_tick(void) | |||
215 | } | 215 | } |
216 | else /* repeat? */ | 216 | else /* repeat? */ |
217 | { | 217 | { |
218 | |||
219 | #if defined(DX50) || defined(DX90) | ||
220 | /* | ||
221 | Power button on these devices reports two distinct key codes, which are | ||
222 | triggerd by a short or medium duration press. Additionlly a long duration press | ||
223 | will trigger a hard reset, which is hardwired. | ||
224 | |||
225 | The time delta between medium and long duration press is not large enough to | ||
226 | register here as power off repeat. A hard reset is triggered before Rockbox | ||
227 | can power off. | ||
228 | |||
229 | To cirumvent the hard reset, Rockbox will shutdown on the first POWEROFF_BUTTON | ||
230 | repeat. POWEROFF_BUTTON is associated with the a medium duration press of the | ||
231 | power button. | ||
232 | */ | ||
233 | if(btn & POWEROFF_BUTTON) | ||
234 | { | ||
235 | sys_poweroff(); | ||
236 | } | ||
237 | #endif | ||
238 | |||
218 | if ( repeat ) | 239 | if ( repeat ) |
219 | { | 240 | { |
220 | if (!post) | 241 | if (!post) |