forked from len0rd/rockbox
Better working USB bootloader mode for H300
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12514 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ab6f95d533
commit
237ff9e615
1 changed files with 13 additions and 16 deletions
|
|
@ -501,16 +501,6 @@ void main(void)
|
||||||
|
|
||||||
usb_init();
|
usb_init();
|
||||||
|
|
||||||
rc = ata_init();
|
|
||||||
if(rc)
|
|
||||||
{
|
|
||||||
reset_screen();
|
|
||||||
printf("ATA error: %d", rc);
|
|
||||||
printf("Insert USB cable and press");
|
|
||||||
printf("a button");
|
|
||||||
while(!(button_get(true) & BUTTON_REL));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* A hack to enter USB mode without using the USB thread */
|
/* A hack to enter USB mode without using the USB thread */
|
||||||
if(usb_detect())
|
if(usb_detect())
|
||||||
{
|
{
|
||||||
|
|
@ -521,10 +511,6 @@ void main(void)
|
||||||
lcd_putsxy((LCD_WIDTH-w)/2, (LCD_HEIGHT-h)/2, msg);
|
lcd_putsxy((LCD_WIDTH-w)/2, (LCD_HEIGHT-h)/2, msg);
|
||||||
lcd_update();
|
lcd_update();
|
||||||
|
|
||||||
#ifdef IRIVER_H300_SERIES
|
|
||||||
sleep(HZ);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_EEPROM_SETTINGS
|
#ifdef HAVE_EEPROM_SETTINGS
|
||||||
if (firmware_settings.initialized)
|
if (firmware_settings.initialized)
|
||||||
{
|
{
|
||||||
|
|
@ -532,8 +518,9 @@ void main(void)
|
||||||
eeprom_settings_store();
|
eeprom_settings_store();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ata_spin();
|
ide_power_enable(true);
|
||||||
ata_enable(false);
|
ata_enable(false);
|
||||||
|
sleep(HZ/20);
|
||||||
usb_enable(true);
|
usb_enable(true);
|
||||||
cpu_idle_mode(true);
|
cpu_idle_mode(true);
|
||||||
while (usb_detect())
|
while (usb_detect())
|
||||||
|
|
@ -551,12 +538,22 @@ void main(void)
|
||||||
|
|
||||||
cpu_idle_mode(false);
|
cpu_idle_mode(false);
|
||||||
usb_enable(false);
|
usb_enable(false);
|
||||||
ata_init(); /* Reinitialize ATA and continue booting */
|
|
||||||
|
|
||||||
reset_screen();
|
reset_screen();
|
||||||
lcd_update();
|
lcd_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = ata_init();
|
||||||
|
if(rc)
|
||||||
|
{
|
||||||
|
reset_screen();
|
||||||
|
printf("ATA error: %d", rc);
|
||||||
|
printf("Insert USB cable and press");
|
||||||
|
printf("a button");
|
||||||
|
while(!(button_get(true) & BUTTON_REL));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
disk_init();
|
disk_init();
|
||||||
|
|
||||||
rc = disk_mount_all();
|
rc = disk_mount_all();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue