forked from len0rd/rockbox
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
This commit is contained in:
parent
eb369bf50f
commit
bfd42d6b59
1 changed files with 9 additions and 4 deletions
|
|
@ -188,7 +188,7 @@ static void reset_configuration(void)
|
||||||
static int boot_menu(void)
|
static int boot_menu(void)
|
||||||
{
|
{
|
||||||
const char* strings[] = {"Boot Rockbox", "Boot OF", "USB mode", "Reset Rockbox configuration"};
|
const char* strings[] = {"Boot Rockbox", "Boot OF", "USB mode", "Reset Rockbox configuration"};
|
||||||
int button, touch;
|
int button, touch, poweroff_repeat = 0;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
@ -206,7 +206,7 @@ redraw:
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
button = button_get_w_tmo(HZ/4);
|
button = button_get_w_tmo(HZ/4);
|
||||||
if(button & (BUTTON_TOUCHSCREEN|BUTTON_REPEAT))
|
if(button & BUTTON_TOUCHSCREEN)
|
||||||
{
|
{
|
||||||
touch = button_get_data();
|
touch = button_get_data();
|
||||||
unsigned int x = touch & 0xFFFF, y = touch >> 16;
|
unsigned int x = touch & 0xFFFF, y = touch >> 16;
|
||||||
|
|
@ -242,9 +242,14 @@ redraw:
|
||||||
if(found != -1)
|
if(found != -1)
|
||||||
goto redraw;
|
goto redraw;
|
||||||
}
|
}
|
||||||
else if(button & (BUTTON_POWER|BUTTON_REPEAT))
|
else if(button & BUTTON_POWER)
|
||||||
|
{
|
||||||
|
if(poweroff_repeat++ > 8)
|
||||||
power_off();
|
power_off();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
poweroff_repeat = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue