forked from len0rd/rockbox
FS#10066 by Michael Chicoine: Sansa AMS bootloader "Hold" switch detection.
(Not for the Fuze nor the Clip, because it seems pointless for them) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20681 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e6cbad6974
commit
aeddacbd14
1 changed files with 13 additions and 0 deletions
|
|
@ -33,6 +33,7 @@
|
|||
#include "storage.h"
|
||||
#include "disk.h"
|
||||
#include "panic.h"
|
||||
#include "power.h"
|
||||
|
||||
int show_logo(void);
|
||||
void main(void)
|
||||
|
|
@ -57,6 +58,18 @@ void main(void)
|
|||
button_init_device();
|
||||
int btn = button_read_device();
|
||||
|
||||
#if !defined(SANSA_FUZE) && !defined(SANSA_CLIP)
|
||||
if (button_hold())
|
||||
{
|
||||
verbose = true;
|
||||
lcd_clear_display();
|
||||
printf("Hold switch on");
|
||||
printf("Shutting down...");
|
||||
sleep(HZ);
|
||||
power_off();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Enable bootloader messages if any button is pressed */
|
||||
if (btn)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue