【发布时间】:2021-09-07 07:02:13
【问题描述】:
我希望使用 MikroC 创建 250 毫秒延迟功能。在下面的代码中,我不明白第 2 节中的 165 是做什么的。
void MSDelay(unsigned int itime); // this is the prototype
void MSDelay(unsigned int itime) {
unsigned int i;
unsigned char j;
for(i=0;i<itime;i++) {
for(j=0;j<165;j++); }
}
}
【问题讨论】:
-
是的,我错了。谢谢我更新了
-
无论何时实现这样的脏延迟循环,所有循环迭代器都必须是
volatile。
标签: c assembly delay pic18 mikroc