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:
Linus Nielsen Feltzing 2007-02-28 00:06:35 +00:00
parent ab6f95d533
commit 237ff9e615

View file

@ -501,16 +501,6 @@ void main(void)
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 */
if(usb_detect())
{
@ -521,10 +511,6 @@ void main(void)
lcd_putsxy((LCD_WIDTH-w)/2, (LCD_HEIGHT-h)/2, msg);
lcd_update();
#ifdef IRIVER_H300_SERIES
sleep(HZ);
#endif
#ifdef HAVE_EEPROM_SETTINGS
if (firmware_settings.initialized)
{
@ -532,8 +518,9 @@ void main(void)
eeprom_settings_store();
}
#endif
ata_spin();
ide_power_enable(true);
ata_enable(false);
sleep(HZ/20);
usb_enable(true);
cpu_idle_mode(true);
while (usb_detect())
@ -551,12 +538,22 @@ void main(void)
cpu_idle_mode(false);
usb_enable(false);
ata_init(); /* Reinitialize ATA and continue booting */
reset_screen();
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();
rc = disk_mount_all();