mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
Fix stm32l0 clock init.
This commit is contained in:
parent
549f20d179
commit
f565267daf
@ -54,16 +54,17 @@
|
||||
//--------------------------------------------------------------------+
|
||||
static inline void board_stm32l0_clock_init(void)
|
||||
{
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct;
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct;
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
|
||||
static RCC_CRSInitTypeDef RCC_CRSInitStruct;
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
|
||||
RCC_CRSInitTypeDef RCC_CRSInitStruct = {0};
|
||||
|
||||
/* Enable HSI Oscillator to be used as System clock source
|
||||
Enable HSI48 Oscillator to be used as USB clock source */
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI48;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
HAL_RCC_OscConfig(&RCC_OscInitStruct);
|
||||
|
||||
/* Select HSI48 as USB clock source */
|
||||
|
@ -54,16 +54,17 @@
|
||||
//--------------------------------------------------------------------+
|
||||
static inline void board_stm32l0_clock_init(void)
|
||||
{
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct;
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct;
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
|
||||
static RCC_CRSInitTypeDef RCC_CRSInitStruct;
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
|
||||
RCC_CRSInitTypeDef RCC_CRSInitStruct = {0};
|
||||
|
||||
/* Enable HSI Oscillator to be used as System clock source
|
||||
Enable HSI48 Oscillator to be used as USB clock source */
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI48;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||
HAL_RCC_OscConfig(&RCC_OscInitStruct);
|
||||
|
||||
/* Select HSI48 as USB clock source */
|
||||
|
Loading…
x
Reference in New Issue
Block a user