summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2010-12-12 20:20:12 +0000
committerFrank Gevaerts <frank@gevaerts.be>2010-12-12 20:20:12 +0000
commit866a822ac615e85bbcb6315c99ce502569f2a3ae (patch)
treed2dd6ebfa1f2e579ae6b8ba228ea7fd6cecb3b39 /firmware/target
parentecd80d888e8fe933c68a3618a1edfe7e667a9227 (diff)
downloadrockbox-866a822ac615e85bbcb6315c99ce502569f2a3ae.tar.gz
rockbox-866a822ac615e85bbcb6315c99ce502569f2a3ae.zip
Only return USB_POWERED if USB_DETECT_BY_DRV is actually defined, which might not be the case for e.g. bootloaders (also fix red)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28820 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/as3525/usb-as3525.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/usb-as3525.c b/firmware/target/arm/as3525/usb-as3525.c
index 1c411b074f..123ff044b5 100644
--- a/firmware/target/arm/as3525/usb-as3525.c
+++ b/firmware/target/arm/as3525/usb-as3525.c
@@ -68,11 +68,14 @@ int usb_detect(void)
68 * hardware power off (pressing the power button) doesn't work anymore 68 * hardware power off (pressing the power button) doesn't work anymore
69 * TODO: Implement USB in rockbox for these players */ 69 * TODO: Implement USB in rockbox for these players */
70 return USB_EXTRACTED; 70 return USB_EXTRACTED;
71#endif 71#elif defined(USB_DETECT_BY_DRV)
72 if(bus_activity && connected) 72 if(bus_activity && connected)
73 return USB_INSERTED; 73 return USB_INSERTED;
74 else if(connected) 74 else if(connected)
75 return USB_POWERED; 75 return USB_POWERED;
76 else 76 else
77 return USB_EXTRACTED; 77 return USB_EXTRACTED;
78#else
79 return connected?USB_INSERTED:USB_EXTRACTED;
80#endif
78} 81}