couldn't get 32L4 running with crystal less mode

This commit is contained in:
hathach 2019-10-03 13:37:10 +07:00
parent 0a20e91cc9
commit 7fd68efe7b
2 changed files with 3 additions and 12 deletions

View File

@ -28,6 +28,7 @@
#include "stm32l4xx.h"
#include "stm32l4xx_hal_conf.h"
#include "stm32l4xx_hal.h"
#define LED_PORT GPIOB
#define LED_PIN GPIO_PIN_2
@ -117,8 +118,6 @@ void board_init(void)
SystemClock_Config();
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_MSI, RCC_MCODIV_1);//RCC_MCO1SOURCE_SYSCLK
/* Enable Power Clock*/
__HAL_RCC_PWR_CLK_ENABLE();
@ -165,20 +164,12 @@ void board_init(void)
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
/* This for ID line */
GPIO_InitStruct.Pin = GPIO_PIN_12;
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
/* Enable USB FS Clock */
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
}
//--------------------------------------------------------------------+
// Board porting API
// board porting API
//--------------------------------------------------------------------+
void board_led_write(bool state)

View File

@ -42,7 +42,7 @@ typedef enum
DCD_EVENT_BUS_RESET = 1,
DCD_EVENT_UNPLUGGED,
DCD_EVENT_SOF,
DCD_EVENT_SUSPEND,
DCD_EVENT_SUSPEND, // TODO LPM Sleep L1 support
DCD_EVENT_RESUME,
DCD_EVENT_SETUP_RECEIVED,