Other Parts Discussed in Thread: SIMPLELINK-CC13XX-CC26XX-SDK
一,定时器初始化代码如下
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.
一,定时器初始化代码如下
您好,
您使用的是哪个 SIMPLELINK-CC13XX-CC26XX-SDK 版本和示例?
您可以尝试将 CONFIG_TIMER_0 换为 CONFIG_TIMER_1 。
我会尝试在开发板复现您的问题,请稍后。
您还可以查看TI 驱动程序运行时 API 和TI 驱动程序示例。
感谢您的测试反馈。
我重新查看了定时器,得知如果是蓝牙程序,使用 Util_constructClock 函数构建定时任务,具体可以参考simple_peripheral例程。
您可以通过此路径打开例程:C:\ti\simplelink_cc13xx_cc26xx_sdk_7_10_01_24\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\simple_peripheral
Util_constructClock 初始化一个 TIRTOS Clock 实例,并到时间触发指定的回调。它是 TIRTOS Clock 的实用程序包装。
您可以点击此处查看特定情况下使用定时器的类型。
希望能够帮助到您。
如果您想通过按键来触发新的定时器,您需要在按键的中断服务程序中调用 Util_constructClock 函数。
在按键触发时,在相应的处理代码中调用 Util_constructClock 来创建新的定时器并启用它。
您的意思是定时器重新配置的时间小于当前计时,所以就没更新定时器的配置,而是在定时器的回调内添加了一些操作,然而这些操作也没反应是吗?
另外您现在是想实现什么样的目标?使用定时器更改时间是做什么?
您将 Timer_setPeriod 改为 Timer_setPeriodMicroseconds()试试。
您可以参阅 Bios_User_Guide 第103页。
您好,
timer_stop() 将停止计时器当前的计数,并且不会重置寄存器。因此,调用timer_start()从最后一个值开始计数。
当定时器正在运行且中断之前调用timer_1_init()时,您需要再次运行timer_start()以使定时器重新启动。
但是我认为使用 Timer_setPeriod() 来更改计时器的周期会更有用。即使在定时器运行期间也可以调用它。但该值将异步更新。
请参阅此了解更多信息:
https://dev.ti.com/tirex/explore/content/ simplelink_cc13xx_cc26xx_sdk_7_10_01_24/docs/drivers/doxygen/html/_timer_8h.html#aee385432bc15af4d7ae919e941341a4c
另外您可以参考以下E2E线程:
希望能够帮助到您。