summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/usb.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index e743c9073f..aa3ab0ae69 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -134,25 +134,20 @@ static void usb_slave_mode(bool on)
134 134
135static void try_reboot(void) 135static void try_reboot(void)
136{ 136{
137#if defined(IRIVER_H10) || defined (IRIVER_H10_5GB)
138 if (button_status()==BUTTON_RIGHT)
139#endif /* defined(IRIVER_H10) || defined (IRIVER_H10_5GB) */
140 {
141#ifndef HAVE_FLASH_STORAGE 137#ifndef HAVE_FLASH_STORAGE
142 ata_sleepnow(); /* Immediately spindown the disk. */ 138 ata_sleepnow(); /* Immediately spindown the disk. */
143 sleep(HZ*2); 139 sleep(HZ*2);
144#endif 140#endif
145 141
146#ifdef IPOD_ARCH /* The following code is based on ipodlinux */ 142#ifdef IPOD_ARCH /* The following code is based on ipodlinux */
147#if CONFIG_CPU == PP5020 143#if CONFIG_CPU == PP5020
148 memcpy((void *)0x40017f00, "diskmode\0\0hotstuff\0\0\1", 21); 144 memcpy((void *)0x40017f00, "diskmode\0\0hotstuff\0\0\1", 21);
149#elif CONFIG_CPU == PP5022 145#elif CONFIG_CPU == PP5022
150 memcpy((void *)0x4001ff00, "diskmode\0\0hotstuff\0\0\1", 21); 146 memcpy((void *)0x4001ff00, "diskmode\0\0hotstuff\0\0\1", 21);
151#endif /* CONFIG_CPU */ 147#endif /* CONFIG_CPU */
152#endif /* IPOD_ARCH */ 148#endif /* IPOD_ARCH */
153 149
154 system_reboot(); /* Reboot */ 150 system_reboot(); /* Reboot */
155 }
156} 151}
157 152
158static void usb_thread(void) 153static void usb_thread(void)
@@ -187,7 +182,11 @@ static void usb_thread(void)
187 else 182 else
188#endif 183#endif
189#ifdef HAVE_USB_POWER 184#ifdef HAVE_USB_POWER
185#if defined(IRIVER_H10) || defined (IRIVER_H10_5GB)
186 if((button_status() & ~USBPOWER_BTN_IGNORE) != USBPOWER_BUTTON)
187#else
190 if((button_status() & ~USBPOWER_BTN_IGNORE) == USBPOWER_BUTTON) 188 if((button_status() & ~USBPOWER_BTN_IGNORE) == USBPOWER_BUTTON)
189#endif
191 { 190 {
192 usb_state = USB_POWERED; 191 usb_state = USB_POWERED;
193#ifdef HAVE_USBSTACK 192#ifdef HAVE_USBSTACK