diff options
| author | lizhen9880 <[email protected]> | 2019-05-21 17:26:34 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-05-21 17:26:34 +0800 |
| commit | d88afc3985bbe4feb088d4fe124bff3bb659c37c (patch) | |
| tree | e234982f58ea7c1ac73d74fc624a7c8ad1c6f2bc /bsp/stm32 | |
| parent | a1898156bfaee0b2bd96fc474cb0d6728e8fba64 (diff) | |
修改systick初始化,由于STM32H7系列与STM32F系列时钟架构不同导致
STM32H7系列与STM32F系列时钟架构不同
STM32F系列systick时钟源来自HCLK
STM32H7系列systick时钟源来自SystemCoreClock
因此增加SOC_SERIES_STM32H7作为编译条件
Diffstat (limited to 'bsp/stm32')
| -rw-r--r-- | bsp/stm32/libraries/HAL_Drivers/drv_common.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_common.c b/bsp/stm32/libraries/HAL_Drivers/drv_common.c index 9bffc026e4..4102815bb2 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_common.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_common.c @@ -26,7 +26,11 @@ FINSH_FUNCTION_EXPORT_ALIAS(reboot, __cmd_reboot, Reboot System); /* SysTick configuration */ void rt_hw_systick_init(void) { +#if defined (SOC_SERIES_STM32H7) + HAL_SYSTICK_Config((HAL_RCCEx_GetD1SysClockFreq()) / RT_TICK_PER_SECOND); +#else HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / RT_TICK_PER_SECOND); +#endif HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } |
