请问我想要通过SysTick来获取准确的延时时间,官方例程是否有提供相应的API接口呢?如果没有的话应该如何操作才能获取准确的延时时间呢?
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.
您好,system tick表示每个tick有多少 usec。 系统实际上以tick计数,它是最小的时间分辨率,需要进行转换才能将其转换为时间。
以 TIRTOS 为例,您可以在 *.cfg file下将其定义为 1000 (1000 usec / one tick)。 请参阅以下内容:
/* * Default value is family dependent. For example, Linux systems often only * support a minimum period of 10000 us and multiples of 10000 us. * TI platforms have a default of 1000 us. */ Clock.tickPeriod = 1000;
然后您应该能够使用并获取延迟,但分辨率为 1mSec。
在 SDK 中找到使用 / 完成此操作的位置。 例如 TO_msec() 函数或 ClockP_usleep()。