diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2007-02-28 00:06:35 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2007-02-28 00:06:35 +0000 |
commit | 237ff9e61546a7eafc4016277c992277058f5a73 (patch) | |
tree | e69c230d525bcf8cb1b3e91e69e1d6f915177602 /bootloader | |
parent | ab6f95d533809b2c2916d9c6d8408303db0a604c (diff) | |
download | rockbox-237ff9e61546a7eafc4016277c992277058f5a73.tar.gz rockbox-237ff9e61546a7eafc4016277c992277058f5a73.zip |
Better working USB bootloader mode for H300
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12514 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r-- | bootloader/main.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/bootloader/main.c b/bootloader/main.c index 27e3a8b303..930a67c693 100644 --- a/bootloader/main.c +++ b/bootloader/main.c @@ -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(); |