【已解决】编译错误,tkl_system_delay 未定义

Zigbee 子设备开发


Post Reply
clcl
Posts: 43

产品类型:Zigbee 门窗控制器(低功耗)
SDK 版本:EFR32MG21A020_TuyaOS-3.6.1

项目需要用延时函数,tal_system.h 里的 tal_system_delay 用不了,提示未定义

Error[Li005]: no definition for "tkl_system_delay" [referenced from tal_system.o(tal_sleep_end_dev_efr32mg21a020f768im32.a)]

还有这些关于 OS 的接口也不能用,tkl 开头也不行,请问要怎么搞?

Error[Li005]: no definition for "tal_queue_post" [referenced from C:\Users\xxxxxx\miot-tuya-port.o]

Error[Li005]: no definition for "tal_thread_create_and_start" [referenced from C:\Users\xxxxxx\tuya_sdk_callback.o]

Error[Li005]: no definition for "tal_queue_fetch" [referenced from C:\Users\xxxxxx\tuya_sdk_callback.o]

huanghuan
Posts: 202

Re: 【求助】编译错误,tkl_system_delay 未定义

tal_sw_timer.h 这个文件中的软定时函数能否满足你的要求?

clcl
Posts: 43

Re: 【求助】编译错误,tkl_system_delay 未定义

tal_sw_timer.h 是软件定时器,我不需要这个

我想问的是关于 OS 的 API,这个 sdk 是没有实现吗?还是有其他函数实现了

huanghuan
Posts: 202

Re: 【求助】编译错误,tkl_system_delay 未定义

这个sdk不是基于OS的,是一个单片机

clcl
Posts: 43

Re: 【求助】编译错误,tkl_system_delay 未定义

好的

我们的程序是基于事件循环的,

注释里说 tuya_main_loop 里不能做复杂操作和延时,所以一开始是用 os 接口的

那我现在放到 tuya_main_loop 里,会有什么影响吗?程序逻辑比较复杂

huanghuan
Posts: 202

Re: 【求助】编译错误,tkl_system_delay 未定义

1.tuya_main_loop 中要加上什么处理?
tuya_main_loop 是在单片机的while1 每次循环都会进入的,如果执行的程序过于复杂,会对软件定时器等任务执行造成影响

2.sw timer 本质上是while1 中进行tick比较判断,时间到达延时后进行回调处理;除中断外,大部分的任务都是通过注册定时器回调执行

clcl
Posts: 43

Re: 【求助】编译错误,tkl_system_delay 未定义

好的,明白了

打算把事件的处理逻辑放到 tuya_main_loop 里,不过这个逻辑有时候可能会占用几百ms的时间

Post Reply