AVR的一个延时程序 20
//采用晶振11.0592MHzvoiddelay_timer_us(uintnTime){TimingDelay=nTime;//使能定时器TCCR1B=0x01;TC...
//采用晶振11.0592MHz
void delay_timer_us(uint nTime)
{
TimingDelay=nTime;
//使能定时器
TCCR1B =0x01;
TCNT1 =0Xfdd7;
while (TimingDelay!=0);
//失能
TCCR1B =0x00;
}
/********获取节拍程序函数********/
void TimingDelay_Decrement(void)
{
if (TimingDelay!=0x00)
{
TimingDelay--;
}
}
这程序对吗,怎么解释 展开
void delay_timer_us(uint nTime)
{
TimingDelay=nTime;
//使能定时器
TCCR1B =0x01;
TCNT1 =0Xfdd7;
while (TimingDelay!=0);
//失能
TCCR1B =0x00;
}
/********获取节拍程序函数********/
void TimingDelay_Decrement(void)
{
if (TimingDelay!=0x00)
{
TimingDelay--;
}
}
这程序对吗,怎么解释 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询