//
// Created by IRIS on 25-2-10.
//

#include "delay.h"

void Delay_Init() {
    HAL_TIM_Base_Start(&htim5); //启动定时器
}

void Delay_us(uint32_t us) {

    uint32_t Time_Now;
    uint32_t Ts;

    __HAL_TIM_SetCounter(&htim5, 0);
    while(Ts < us) {
        Time_Now = __HAL_TIM_GET_COUNTER(&htim5);
        Ts = Time_Now * 0.1;
    }

}