summaryrefslogtreecommitdiff
path: root/chip/stm32/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/usb.c')
-rw-r--r--chip/stm32/usb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/chip/stm32/usb.c b/chip/stm32/usb.c
index a0a37524be..b4dfb31fb5 100644
--- a/chip/stm32/usb.c
+++ b/chip/stm32/usb.c
@@ -326,3 +326,8 @@ void usb_release(void)
/* disable USB device clock */
STM32_RCC_APB1ENR &= ~STM32_RCC_PB1_USB;
}
+
+int usb_is_enabled(void)
+{
+ return (STM32_RCC_APB1ENR & STM32_RCC_PB1_USB) ? 1 : 0;
+}