cc3200延时函数
工程师您好!我想知道MAP_UtilsDelay这个函数具体定义在哪里
编译后,选择这个函数,点右键,有个定位到这个函数的定义。就找到了。
MAP_UtilsDelay(80000); for delay about 0.5sec
< CC3200: Delay in seconds/msec/microsecond >
In http: processors.wiki.ti.com/index.php/CC32xx_Power_Management_Framework, it said:
- Clock tick at 80 Mhz.
So MAP_Utilsdelay(8000000) may delay ~0.3sec or ~0.5sec as you mean.
But in oob example, Why MAP_UtilsDelay(8000000) is mean ~10sec?
Wait ~10 sec to check if connection to specifed AP succeeds
while(!(IS_CONNECTED(g_ulStatus)) || !(IS_IP_ACQUIRED(g_ulStatus)))
{
#ifndef SL_PLATFORM_MULTI_THREADED
_SlNonOsMainLoopTask();
#endif
MAP_UtilsDelay(8000000);
if(g_usConnectIndex >= usConnTimeout)
{
break;
}
g_usConnectIndex++;
}
"Clock tick at 80 Mhz" is correct information.
Further, in the OOB example you will find that there is a retry count and then timeout. So it means that the loop will execute usConnTimeout number of times. Hence the time it takes is actually - (usConnTimeout * MAP_UtilsDelay(8000000)). This may have been approximated and mentioned in the comment.
I am using following macro. Its not exact but close enough (at least for my application)
#define SEC_TO_LOOP(x) ((80000000/5)*x)