fix H10 not rebooting on usb connect. Apologies to H10 users who enjoyed their free but unintended USB stack.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16734 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Frank Gevaerts 2008-03-21 20:22:04 +00:00
parent d02c79c03f
commit 7ee63e22c5

View file

@ -134,25 +134,20 @@ static void usb_slave_mode(bool on)
static void try_reboot(void)
{
#if defined(IRIVER_H10) || defined (IRIVER_H10_5GB)
if (button_status()==BUTTON_RIGHT)
#endif /* defined(IRIVER_H10) || defined (IRIVER_H10_5GB) */
{
#ifndef HAVE_FLASH_STORAGE
ata_sleepnow(); /* Immediately spindown the disk. */
sleep(HZ*2);
ata_sleepnow(); /* Immediately spindown the disk. */
sleep(HZ*2);
#endif
#ifdef IPOD_ARCH /* The following code is based on ipodlinux */
#if CONFIG_CPU == PP5020
memcpy((void *)0x40017f00, "diskmode\0\0hotstuff\0\0\1", 21);
memcpy((void *)0x40017f00, "diskmode\0\0hotstuff\0\0\1", 21);
#elif CONFIG_CPU == PP5022
memcpy((void *)0x4001ff00, "diskmode\0\0hotstuff\0\0\1", 21);
memcpy((void *)0x4001ff00, "diskmode\0\0hotstuff\0\0\1", 21);
#endif /* CONFIG_CPU */
#endif /* IPOD_ARCH */
system_reboot(); /* Reboot */
}
system_reboot(); /* Reboot */
}
static void usb_thread(void)
@ -187,7 +182,11 @@ static void usb_thread(void)
else
#endif
#ifdef HAVE_USB_POWER
#if defined(IRIVER_H10) || defined (IRIVER_H10_5GB)
if((button_status() & ~USBPOWER_BTN_IGNORE) != USBPOWER_BUTTON)
#else
if((button_status() & ~USBPOWER_BTN_IGNORE) == USBPOWER_BUTTON)
#endif
{
usb_state = USB_POWERED;
#ifdef HAVE_USBSTACK