mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-07 05:35:02 -05:00
h1x0/h300: fix h300 bootloader hold switch check
This fixes an early boot bug on the h300 where hold_status is read before it has a chance to properly check whether the hold switch is even active. This was accomplished by porting over the method the h1x0 uses to perform the same check. Change-Id: I04679d82f65a2edcbee4be9a146437c3988040a2
This commit is contained in:
parent
29a20bd209
commit
fc5c8192ff
2 changed files with 21 additions and 12 deletions
|
|
@ -429,15 +429,13 @@ void main(void)
|
||||||
|
|
||||||
adc_init();
|
adc_init();
|
||||||
button_init();
|
button_init();
|
||||||
|
sleep(HZ/50); /* Allow the button driver to check the buttons */
|
||||||
|
|
||||||
/* Only check remote hold status if remote power button was actually used. */
|
/* Only check remote hold status if remote power button was actually used. */
|
||||||
if (rc_on_button)
|
if (rc_on_button)
|
||||||
{
|
{
|
||||||
lcd_remote_init();
|
lcd_remote_init();
|
||||||
|
|
||||||
/* Allow the button driver to check the buttons */
|
|
||||||
sleep(HZ/50);
|
|
||||||
|
|
||||||
if (remote_button_hold())
|
if (remote_button_hold())
|
||||||
hold_status = true;
|
hold_status = true;
|
||||||
}
|
}
|
||||||
|
|
@ -476,8 +474,6 @@ void main(void)
|
||||||
printf("Rockbox boot loader");
|
printf("Rockbox boot loader");
|
||||||
printf("Version %s", rbversion);
|
printf("Version %s", rbversion);
|
||||||
|
|
||||||
/* No need to wait here more because lcd_init and others already do that. */
|
|
||||||
// sleep(HZ/50); /* Allow the button driver to check the buttons */
|
|
||||||
rec_button = ((button_status() & BUTTON_REC) == BUTTON_REC)
|
rec_button = ((button_status() & BUTTON_REC) == BUTTON_REC)
|
||||||
|| ((button_status() & BUTTON_RC_REC) == BUTTON_RC_REC);
|
|| ((button_status() & BUTTON_RC_REC) == BUTTON_RC_REC);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -425,6 +425,22 @@ void main(void)
|
||||||
|
|
||||||
adc_init();
|
adc_init();
|
||||||
button_init();
|
button_init();
|
||||||
|
sleep(HZ/50); /* Allow the button driver to check the buttons */
|
||||||
|
|
||||||
|
/* Only check remote hold status if remote power button was actually used. */
|
||||||
|
if (rc_on_button)
|
||||||
|
{
|
||||||
|
lcd_remote_init();
|
||||||
|
|
||||||
|
if (remote_button_hold())
|
||||||
|
hold_status = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check main hold switch status too. */
|
||||||
|
if (on_button && button_hold())
|
||||||
|
{
|
||||||
|
hold_status = true;
|
||||||
|
}
|
||||||
|
|
||||||
/* Power on the hard drive early, to speed up the loading. */
|
/* Power on the hard drive early, to speed up the loading. */
|
||||||
if (!hold_status && !recovery_mode)
|
if (!hold_status && !recovery_mode)
|
||||||
|
|
@ -436,7 +452,10 @@ void main(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd_init();
|
lcd_init();
|
||||||
lcd_remote_init();
|
|
||||||
|
if (!rc_on_button)
|
||||||
|
lcd_remote_init();
|
||||||
|
|
||||||
font_init();
|
font_init();
|
||||||
|
|
||||||
lcd_setfont(FONT_SYSFIXED);
|
lcd_setfont(FONT_SYSFIXED);
|
||||||
|
|
@ -446,7 +465,6 @@ void main(void)
|
||||||
printf("Rockbox boot loader");
|
printf("Rockbox boot loader");
|
||||||
printf("Version %s", rbversion);
|
printf("Version %s", rbversion);
|
||||||
|
|
||||||
sleep(HZ/50); /* Allow the button driver to check the buttons */
|
|
||||||
rec_button = ((button_status() & BUTTON_REC) == BUTTON_REC)
|
rec_button = ((button_status() & BUTTON_REC) == BUTTON_REC)
|
||||||
|| ((button_status() & BUTTON_RC_REC) == BUTTON_RC_REC);
|
|| ((button_status() & BUTTON_RC_REC) == BUTTON_RC_REC);
|
||||||
|
|
||||||
|
|
@ -457,11 +475,6 @@ void main(void)
|
||||||
|
|
||||||
/* Don't start if the Hold button is active on the device you
|
/* Don't start if the Hold button is active on the device you
|
||||||
are starting with */
|
are starting with */
|
||||||
if ((on_button && button_hold()) ||
|
|
||||||
(rc_on_button && remote_button_hold()))
|
|
||||||
{
|
|
||||||
hold_status = true;
|
|
||||||
}
|
|
||||||
if ((hold_status || recovery_mode) && !rtc_alarm &&
|
if ((hold_status || recovery_mode) && !rtc_alarm &&
|
||||||
(usb_detect() != USB_INSERTED) && !charger_inserted())
|
(usb_detect() != USB_INSERTED) && !charger_inserted())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue