imx233/bootloader: power off on hold

Change-Id: I3081ca6e47bed5a69e6163cb539d0a8516b689d2
This commit is contained in:
Amaury Pouly 2013-09-26 17:52:29 +02:00
parent 0897794f44
commit 6dcd465b18

View file

@ -156,6 +156,18 @@ void main(uint32_t arg, uint32_t addr)
backlight_init(); backlight_init();
button_init(); button_init();
/* dummy read, might be necessary to init things */
button_read_device();
#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);