HAL库中HAL_Delay()的定义:
__weak void HAL_Delay(uint32_t Delay){
uint32_t tickstart = HAL_GetTick();
uint32_t wait = Delay();
if(wait < HAL_MAX_DELAY){
wait += (uint32_t)(uwTickFreq);
}
while((HAL_GetTick() - tickstart) < wait){
}
}