TI 的例程当中有提供延时函数吗?TMS570LC43
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您可以使用 RTI 和下面的代码:
{
U32 waitTill = currentRTIvalue + wtime;
while((I32)(currentRTIvalue - waitTill) < 0)
{ /* do nothing */ }
}
将“currentRTIvalue”替换为使用的 RTI 计数器
优点:注入中断没有问题
缺点 1:您需要将 RTI 编程为比等待时间倒置值更高的频率
缺点 2:它仅对小延迟(小于 ~20-40us)有效。对于更长的延迟,最好使用 RTOS 并将这段时间用于另一项任务。
freeRTOS 具有使用 RTI 比较 0 的预定义定时器。
freeRTOS has its predefined timer using RTI compare 0.
You can add other RTI compares to prvSetupTimerInterrupt() function manually.
请看