forked from len0rd/rockbox
imx233/bl: usb mode has priority over hold
Change-Id: I0d124eaed0ebf1ca18c022684a96dfbf7d740c7e
This commit is contained in:
parent
7a828ac5e2
commit
f75310598c
1 changed files with 18 additions and 17 deletions
|
|
@ -156,23 +156,6 @@ void main(uint32_t arg, uint32_t addr)
|
||||||
backlight_init();
|
backlight_init();
|
||||||
|
|
||||||
button_init();
|
button_init();
|
||||||
/* dummy read, might be necessary to init things */
|
|
||||||
#ifdef HAVE_BUTTON_DATA
|
|
||||||
int data;
|
|
||||||
button_read_device(&data);
|
|
||||||
#else
|
|
||||||
button_read_device();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAS_BUTTON_HOLD
|
|
||||||
if(button_hold())
|
|
||||||
{
|
|
||||||
printf("Hold switch on");
|
|
||||||
printf("Shutting down...");
|
|
||||||
sleep(HZ);
|
|
||||||
power_off();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
printf("%s: %s", MSG(240, "Ver", "Boot version"), RBVERSION);
|
printf("%s: %s", MSG(240, "Ver", "Boot version"), RBVERSION);
|
||||||
printf("%s: %x ", MSG(240, "Arg", "Boot arg"), arg);
|
printf("%s: %x ", MSG(240, "Arg", "Boot arg"), arg);
|
||||||
|
|
@ -202,6 +185,24 @@ void main(uint32_t arg, uint32_t addr)
|
||||||
if(usb_detect() == USB_INSERTED)
|
if(usb_detect() == USB_INSERTED)
|
||||||
usb_mode(HZ);
|
usb_mode(HZ);
|
||||||
|
|
||||||
|
/* dummy read, might be necessary to init things */
|
||||||
|
#ifdef HAVE_BUTTON_DATA
|
||||||
|
int data;
|
||||||
|
button_read_device(&data);
|
||||||
|
#else
|
||||||
|
button_read_device();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAS_BUTTON_HOLD
|
||||||
|
if(button_hold())
|
||||||
|
{
|
||||||
|
printf("Hold switch on");
|
||||||
|
printf("Shutting down...");
|
||||||
|
sleep(HZ);
|
||||||
|
power_off();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
printf("Loading firmware");
|
printf("Loading firmware");
|
||||||
|
|
||||||
loadbuffer = (unsigned char*)loadaddress;
|
loadbuffer = (unsigned char*)loadaddress;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue