newPtz/drivers/delay_us.c

24 lines
553 B
C
Raw Normal View History

// #include "delay_us.h"
// #include "rtthread.h"
// #include <core_cm4.h>
// #include "gd32f4xx_gpio.h"
// /*
// @ brief 延时函数
// @ param
// @ return
// @ note 2022-5-23
// */
// static void delay_us(int us)
// {
// rt_uint32_t start, now, delta, reload, us_tick;
// start = SysTick->VAL;
// reload = SysTick->LOAD;
// us_tick = SystemCoreClock / 1000000UL;
// do
// {
// now = SysTick->VAL;
// delta = start > now ? start - now : reload + start - now;
// } while (delta < us_tick * us);
// }