summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-09-26 17:52:29 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-09-26 17:52:29 +0200
commit6dcd465b1802ccfac39d1657febd0ce515d71460 (patch)
tree964ddc27343e7dce493c06e6487774ccd465165a
parent0897794f445c1cbe5c0da4fb95d203491c3871a7 (diff)
downloadrockbox-6dcd465.tar.gz
rockbox-6dcd465.zip
imx233/bootloader: power off on hold
Change-Id: I3081ca6e47bed5a69e6163cb539d0a8516b689d2
-rw-r--r--bootloader/imx233.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/bootloader/imx233.c b/bootloader/imx233.c
index 79e5708bad..8ac74f10bc 100644
--- a/bootloader/imx233.c
+++ b/bootloader/imx233.c
@@ -156,6 +156,18 @@ void main(uint32_t arg, uint32_t addr)
backlight_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: %x ", MSG(240, "Arg", "Boot arg"), arg);