2019-07-14 16:02发布
Oo一笑 发表于 2018-11-15 19:01 __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) {
最多设置5个标签!
{
/*Configure the SysTick to have interrupt in 1ms time basis*/
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
/*Configure the SysTick IRQ priority */
HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority ,0);
/* Return function status */
return HAL_OK;
}
static __IO uint32_t uwTick;
__weak void HAL_IncTick(void)
{
uwTick++;
}
__weak uint32_t HAL_GetTick(void)
{
return uwTick;
}
__weak void HAL_Delay(__IO uint32_t Delay)
{
uint32_t tickstart = HAL_GetTick();
while((HAL_GetTick() - tickstart) < Delay)
{
}
}
谢谢,明白了
一周热门 更多>