summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/usb-as3525.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/usb-as3525.c b/firmware/target/arm/as3525/usb-as3525.c
index 6dcf99934e..6ff235dfce 100644
--- a/firmware/target/arm/as3525/usb-as3525.c
+++ b/firmware/target/arm/as3525/usb-as3525.c
@@ -45,18 +45,23 @@ void usb_enable(bool on)
45void usb_insert_int(void) 45void usb_insert_int(void)
46{ 46{
47 usb_status = USB_INSERTED; 47 usb_status = USB_INSERTED;
48#ifdef USB_STATUS_BY_EVENT
48 usb_status_event(USB_POWERED); 49 usb_status_event(USB_POWERED);
50#endif
49} 51}
50 52
51void usb_remove_int(void) 53void usb_remove_int(void)
52{ 54{
53 usb_status = USB_EXTRACTED; 55 usb_status = USB_EXTRACTED;
56#ifdef USB_STATUS_BY_EVENT
54 usb_status_event(USB_UNPOWERED); 57 usb_status_event(USB_UNPOWERED);
58#endif
55} 59}
56 60
57void usb_drv_usb_detect_event(void) 61void usb_drv_usb_detect_event(void)
58{ 62{
59#if CONFIG_CPU != AS3525v2 || defined(USE_ROCKBOX_USB) 63#if (CONFIG_CPU != AS3525v2 || defined(USE_ROCKBOX_USB)) \
64 && defined (USB_STATUS_BY_EVENT)
60/* Rebooting on USB plug can crash these players in a state where 65/* Rebooting on USB plug can crash these players in a state where
61 * hardware power off (pressing the power button) doesn't work anymore 66 * hardware power off (pressing the power button) doesn't work anymore
62 * TODO: Implement USB in rockbox for these players */ 67 * TODO: Implement USB in rockbox for these players */