summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-09-01 07:57:56 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-09-01 07:57:56 +0000
commitbfd42d6b5903ce1c5080281aeddaa95e70285800 (patch)
treea0ab0dfc0a56c61f1554ffc4492c4b5c3945a0b8
parenteb369bf50f5a0adf061455b27ad5a023e6b4106b (diff)
downloadrockbox-bfd42d6b5903ce1c5080281aeddaa95e70285800.tar.gz
rockbox-bfd42d6b5903ce1c5080281aeddaa95e70285800.zip
Onda VX747/VX777 bootloader: power off after holding the poweroff button for 2 seconds (BUTTON_REPEAT doesn't seem to work in bootloader)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22589 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--bootloader/ondavx747.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/bootloader/ondavx747.c b/bootloader/ondavx747.c
index 0cae73c174..20f47d5224 100644
--- a/bootloader/ondavx747.c
+++ b/bootloader/ondavx747.c
@@ -188,7 +188,7 @@ static void reset_configuration(void)
188static int boot_menu(void) 188static int boot_menu(void)
189{ 189{
190 const char* strings[] = {"Boot Rockbox", "Boot OF", "USB mode", "Reset Rockbox configuration"}; 190 const char* strings[] = {"Boot Rockbox", "Boot OF", "USB mode", "Reset Rockbox configuration"};
191 int button, touch; 191 int button, touch, poweroff_repeat = 0;
192 unsigned int i; 192 unsigned int i;
193 193
194 verbose = true; 194 verbose = true;
@@ -206,7 +206,7 @@ redraw:
206 while(1) 206 while(1)
207 { 207 {
208 button = button_get_w_tmo(HZ/4); 208 button = button_get_w_tmo(HZ/4);
209 if(button & (BUTTON_TOUCHSCREEN|BUTTON_REPEAT)) 209 if(button & BUTTON_TOUCHSCREEN)
210 { 210 {
211 touch = button_get_data(); 211 touch = button_get_data();
212 unsigned int x = touch & 0xFFFF, y = touch >> 16; 212 unsigned int x = touch & 0xFFFF, y = touch >> 16;
@@ -242,8 +242,13 @@ redraw:
242 if(found != -1) 242 if(found != -1)
243 goto redraw; 243 goto redraw;
244 } 244 }
245 else if(button & (BUTTON_POWER|BUTTON_REPEAT)) 245 else if(button & BUTTON_POWER)
246 power_off(); 246 {
247 if(poweroff_repeat++ > 8)
248 power_off();
249 }
250 else
251 poweroff_repeat = 0;
247 } 252 }
248} 253}
249 254