完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
for (stop = start = tickGet (); start == stop; start = tickGet ())
; /* wait for clock turn over */ 这句是什么意思,在我理解看来就是延迟了几行代码而已? |
|
相关推荐
5个回答
|
|
延时小于等于1个tick。
最佳答案
|
|
|
|
完整函数如下
void ADT_L0_CALL_CONV ADT_L0_msSleep(ADT_L0_UINT32 msDelay) { static int delayLoop = 0; int ix; int iy; int maxLoop; int start; int stop; int mpt; /* microsecs per tick */ msDelay = msDelay*1000; /* Convert input to usec*/ if (delayLoop == 0 || msDelay == 0xffffffff) /* need calibration? Run first time only when delayLoop=0 */ { start = 0; stop = 0; mpt = (1000 * 1000) / sysClkRateGet (); /* microsecs per tick */ for (delayLoop = 1; delayLoop < 0x1000 && stop == start; delayLoop<<=1) { for (stop = start = tickGet (); start == stop; start = tickGet ()) ; /* wait for clock turn over */ ADT_L0_msSleep(mpt/1000); /* single recursion */ stop = tickGet (); } maxLoop = delayLoop / 2; /* loop above overshoots */ start = 0; stop = 0; if (delayLoop < 4) delayLoop = 4; for (delayLoop /= 4; delayLoop for (stop = start = tickGet (); start == stop; start = tickGet ()) ; /* wait for clock turn over */ ADT_L0_msSleep(mpt/1000); /* single recursion */ stop = tickGet (); } } /* Main delay loop after calibration above*/ for (iy = 0; iy < msDelay; iy++) { for (ix = 0; ix < delayLoop; ix++); } } |
|
|
|
给你踩踩,,,过来瞅瞅。。。(*^__^*) 嘻嘻……
|
|
|
|
|
|
|
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
417 浏览 0 评论
430 浏览 1 评论
基于瑞萨FPB-RA4E2智能床头灯项目——1编译环境搭建与点亮驱动ws2812全彩LED
393 浏览 0 评论
嵌入式学习-飞凌嵌入式ElfBoard ELF 1板卡-LCD显示图片编程示例之介绍mmap
974 浏览 0 评论
《DNESP32S3使用指南-IDF版_V1.6》第二章 常用的C语言知识点
1055 浏览 0 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
11773 浏览 31 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 23:06 , Processed in 0.612370 second(s), Total 49, Slave 43 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号