对于systick,有以下代码
void SystemInit(void)
{
M0P_SYSCTRL->RCL_CR_f.TRIM = (*((volatile uint16_t*) (0x00100C22ul)));
M0P_SYSCTRL->RCH_CR_f.TRIM = (*((volatile uint16_t*) (0x00100C08ul)));
SystemCoreClockUpdate();
_HidePinInit();
}
///< SysTick配置,定时1s,系统时钟默认RCH 4MHz
SysTick_Config(SystemCoreClock); //
这里 SystemCoreClock由以下函数获得
//add clock source.
void SystemCoreClockUpdate (void) // Update SystemCoreClock variable
{
SystemCoreClock = Sysctrl_GetHClkFreq();
}
|