diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-15 11:52:29 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-15 11:52:29 +0000 |
commit | e285511a23046e3a72b819f183fd83c6949e2cb4 (patch) | |
tree | e56d0acb1463bee4008b2da8030a97b2ea0b366d /stmhal/stm32f4xx_hal_msp.c | |
parent | 87e423b8661c2a058307125fd3a47dfc32cca888 (diff) |
stmhal: Get USB CDC REPL working.
New USB HAL is quite a bit improved over previous one. Now has better
callbacks and flow control.
REPL over USB CDC now works as before, except for soft-reset (since USB
driver uses malloc...).
Diffstat (limited to 'stmhal/stm32f4xx_hal_msp.c')
-rw-r--r-- | stmhal/stm32f4xx_hal_msp.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/stmhal/stm32f4xx_hal_msp.c b/stmhal/stm32f4xx_hal_msp.c index 55bf62463..6ab992a63 100644 --- a/stmhal/stm32f4xx_hal_msp.c +++ b/stmhal/stm32f4xx_hal_msp.c @@ -47,6 +47,8 @@ /* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"
+#include "usbd_cdc.h"
+#include "usbd_cdc_interface.h"
/** @addtogroup STM32F4xx_HAL_Driver
* @{
@@ -73,11 +75,11 @@ * @param None
* @retval None
*/
-void HAL_MspInit(void)
-{
- /* NOTE : This function is generated automatically by MicroXplorer and eventually
- modified by the user
- */
+void HAL_MspInit(void) {
+ // set up the timer for USBD CDC
+ USBD_CDC_TIMx_CLK_ENABLE();
+ HAL_NVIC_SetPriority(USBD_CDC_TIMx_IRQn, 6, 0);
+ HAL_NVIC_EnableIRQ(USBD_CDC_TIMx_IRQn);
}
/**
@@ -85,11 +87,10 @@ void HAL_MspInit(void) * @param None
* @retval None
*/
-void HAL_MspDeInit(void)
-{
- /* NOTE : This function is generated automatically by MicroXplorer and eventually
- modified by the user
- */
+void HAL_MspDeInit(void) {
+ // reset USBD CDC timer
+ USBD_CDC_TIMx_FORCE_RESET();
+ USBD_CDC_TIMx_RELEASE_RESET();
}
/**
|