diff options
Diffstat (limited to 'firmware/target/arm/as3525/usb-as3525.c')
-rw-r--r-- | firmware/target/arm/as3525/usb-as3525.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/usb-as3525.c b/firmware/target/arm/as3525/usb-as3525.c index 9fcf2cb2f3..a10f8a441a 100644 --- a/firmware/target/arm/as3525/usb-as3525.c +++ b/firmware/target/arm/as3525/usb-as3525.c @@ -41,13 +41,17 @@ void usb_enable(bool on) void usb_init_device(void) { +#ifdef USB_DETECT_PIN GPIOA_DIR &= ~(1 << USB_DETECT_PIN); /* set as input */ +#endif } int usb_detect(void) { +#ifdef USB_DETECT_PIN if (GPIOA_PIN( USB_DETECT_PIN )) return USB_INSERTED; else +#endif return USB_EXTRACTED; } |