stm32的微秒延时程序
延时函数为:
本文引用地址:https://www.eepw.com.cn/article/201611/316910.htm #definedelayUs(x){ unsigned int _dcnt;
_dcnt=(x*16);
while(_dcnt-- > 0)
{ continue; }
}
x---------为延时时间(单位为us)
其中_dcnt=(x*16); 中的16,是可以改的,改为8的时候延时间时间为x*0.5。
延时函数为:
本文引用地址:https://www.eepw.com.cn/article/201611/316910.htm #definedelayUs(x){ unsigned int _dcnt;
_dcnt=(x*16);
while(_dcnt-- > 0)
{ continue; }
}
x---------为延时时间(单位为us)
其中_dcnt=(x*16); 中的16,是可以改的,改为8的时候延时间时间为x*0.5。
评论