1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Frank Gevaerts 2010-12-12 20:20:12 +00:00
parent ecd80d888e
commit 866a822ac6

View file

@ -68,11 +68,14 @@ int usb_detect(void)
* hardware power off (pressing the power button) doesn't work anymore
* TODO: Implement USB in rockbox for these players */
return USB_EXTRACTED;
#endif
#elif defined(USB_DETECT_BY_DRV)
if(bus_activity && connected)
return USB_INSERTED;
else if(connected)
return USB_POWERED;
else
return USB_EXTRACTED;
#else
return connected?USB_INSERTED:USB_EXTRACTED;
#endif
}