aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c')
-rw-r--r--os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c
index 33dc0a9bd..e4dc04c7c 100644
--- a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c
+++ b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c
@@ -38,9 +38,7 @@
#define EP0_MAX_INSIZE 64
#define EP0_MAX_OUTSIZE 64
-#if defined(STM32F7XX)
-#define GCCFG_INIT_VALUE GCCFG_PWRDWN
-#else
+#if STM32_OTG_STEPPING == 1
#if defined(BOARD_OTG_NOVBUSSENS)
#define GCCFG_INIT_VALUE (GCCFG_NOVBUSSENS | GCCFG_VBUSASEN | \
GCCFG_VBUSBSEN | GCCFG_PWRDWN)
@@ -48,6 +46,16 @@
#define GCCFG_INIT_VALUE (GCCFG_VBUSASEN | GCCFG_VBUSBSEN | \
GCCFG_PWRDWN)
#endif
+
+#elif STM32_OTG_STEPPING == 2
+#if defined(BOARD_OTG_NOVBUSSENS)
+#define GCCFG_INIT_VALUE GCCFG_PWRDWN
+#else
+#define GCCFG_INIT_VALUE (GCCFG_VBDEN | GCCFG_PWRDWN)
+#endif
+
+#else
+#error "unsupported STM32_OTG_STEPPING"
#endif
/*===========================================================================*/