summaryrefslogtreecommitdiff
path: root/stmhal/usbd_conf.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-12 16:13:29 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-12 16:13:29 +0000
commit131185a2b84de5432c33b2aa46bff8c2354297ca (patch)
tree1aff757cd5d22d338bc06323dc5acd0cce285264 /stmhal/usbd_conf.c
parent7630d9ca0e7ed9dcea675b85923503f5d922f6ce (diff)
stmhal: Add MICROPY_HW_USB_OTG_ID_PIN config, set for relevant boards.
This config option is for the USB OTG pin, pin A10. This is used on some boards but not others. Eg PYBv3 uses PA10 for LED(2), so it shouldn't be used for OTG ID (actually PA10 is multiplexed on this board, but defaults to LED(2)). Partially addresses issue #1059.
Diffstat (limited to 'stmhal/usbd_conf.c')
-rw-r--r--stmhal/usbd_conf.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/stmhal/usbd_conf.c b/stmhal/usbd_conf.c
index 2ff31c989..eddf1d626 100644
--- a/stmhal/usbd_conf.c
+++ b/stmhal/usbd_conf.c
@@ -33,10 +33,6 @@
#include "stm32f4xx_hal.h"
#include "usbd_core.h"
-#if !defined(USE_USB_OTG_ID)
-#define USE_USB_OTG_ID 1
-#endif
-
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
@@ -79,7 +75,8 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd)
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
#endif
-#if USE_USB_OTG_ID
+#if defined(MICROPY_HW_USB_OTG_ID_PIN)
+ // USB ID pin is always A10
GPIO_InitStruct.Pin = GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
GPIO_InitStruct.Pull = GPIO_PULLUP;