From 7ceec769f78021ba0b728ba20eea3b7a53f1e527 Mon Sep 17 00:00:00 2001 From: gevaerts Date: Fri, 21 Mar 2008 20:22:04 +0000 Subject: [PATCH] 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 --- firmware/usb.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/firmware/usb.c b/firmware/usb.c index e743c9073..aa3ab0ae6 100644 --- a/firmware/usb.c +++ b/firmware/usb.c @@ -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 -- 2.11.4.GIT