修改systick初始化,由于STM32H7系列与STM32F系列时钟架构不同导致
STM32H7系列与STM32F系列时钟架构不同 STM32F系列systick时钟源来自HCLK STM32H7系列systick时钟源来自SystemCoreClock 因此增加SOC_SERIES_STM32H7作为编译条件
This commit is contained in:
parent
a1898156bf
commit
d88afc3985
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue