HD200 - add support for remote in bootloader

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27316 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Marcin Bukat 2010-07-06 17:30:10 +00:00
parent f99e4fb3bf
commit 57484bdf04

View file

@ -186,6 +186,9 @@ static void rb_boot(void)
{
int rc;
/* boost to speedup rb image loading */
cpu_boost(true);
rc = storage_init();
if(rc)
{
@ -218,6 +221,7 @@ static void rb_boot(void)
return;
}
cpu_boost(false);
start_rockbox();
}
@ -272,6 +276,7 @@ static void bootmenu(void)
switch (button)
{
case BUTTON_PREV:
case BUTTON_RC_PREV:
if (option > rockbox)
option--;
else
@ -279,6 +284,7 @@ static void bootmenu(void)
break;
case BUTTON_NEXT:
case BUTTON_RC_NEXT:
if (option < shutdown)
option++;
else
@ -286,6 +292,7 @@ static void bootmenu(void)
break;
case BUTTON_PLAY:
case BUTTON_RC_PLAY:
case (BUTTON_PLAY|BUTTON_REC):
reset_screen();
@ -322,6 +329,9 @@ void main(void)
unsigned int event = EVENT_NONE;
unsigned int last_event = EVENT_NONE;
/* this is default mode after power_init() */
bool high_current_charging = true;
power_init();
system_init();
@ -360,7 +370,7 @@ void main(void)
event = EVENT_NONE;
button = button_get_w_tmo(HZ);
if ( button & BUTTON_PLAY )
if ( (button & BUTTON_PLAY) || (button & BUTTON_RC_PLAY) )
event |= EVENT_ON;
if ( usb_detect() == USB_INSERTED )
@ -388,8 +398,7 @@ void main(void)
case EVENT_AC:
if (!(last_event & EVENT_AC))
{
/* high current charge */
or_l((1<<15),&GPIO_OUT);
/* reset charging circuit */
and_l(~(1<<23), &GPIO_ENABLE);
}
@ -407,10 +416,26 @@ void main(void)
blink_toggle = !blink_toggle;
}
else /* end of charge condition */
{
/* put LTC1733 into shutdown mode */
or_l((1<<23), &GPIO_ENABLE);
if (high_current_charging)
{
/* switch to low current mode */
and_l(~(1<<15), &GPIO_OUT);
/* reset charging circuit */
and_l(~(1<<23), &GPIO_ENABLE);
high_current_charging = false;
}
else
{
lcd_putstring_centered(complete_msg);
}
}
check_battery();
break;
@ -418,8 +443,7 @@ void main(void)
case (EVENT_USB | EVENT_AC):
if (!(last_event & EVENT_AC))
{
/* high current charge */
or_l((1<<15),&GPIO_OUT);
/* reset charger circuit */
and_l(~(1<<23), &GPIO_ENABLE);
}
@ -442,6 +466,13 @@ void main(void)
break;
default:
if (last_event & EVENT_USB)
{
/* USB unplug */
usb_enable(false);
ide_power_enable(false);
}
/* spurious wakeup */
__shutdown();
break;