diff options
| author | Dave Hylands | 2014-03-14 00:51:26 -0700 |
|---|---|---|
| committer | Dave Hylands | 2014-03-14 09:48:49 -0700 |
| commit | 0a64c92a9c3bd7d648c8a0d087fa7e739a5eeaa3 (patch) | |
| tree | 0d36bb17c7bbb00c14a61a072d667162d7c9ff8f /stmhal/usbd_conf.c | |
| parent | 33bdd2119d9ca28404acc2b0891d5a74997a0d05 (diff) | |
stmhal - add led support. Add netduino_plus_2 support
Tweaked a couple of the USB files to compile if neither dev nor host was defined.
Tested on netduiono plus 2 and stm32f4discovery boards
Diffstat (limited to 'stmhal/usbd_conf.c')
| -rw-r--r-- | stmhal/usbd_conf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/stmhal/usbd_conf.c b/stmhal/usbd_conf.c index 8594db13a..4a4414afe 100644 --- a/stmhal/usbd_conf.c +++ b/stmhal/usbd_conf.c @@ -29,6 +29,10 @@ #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 -------------------------------------------------------------*/
@@ -68,11 +72,13 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd) GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+#if USE_USB_OTG_ID
GPIO_InitStruct.Pin = GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+#endif
/* Enable USB FS Clocks */
__USB_OTG_FS_CLK_ENABLE();
|
