TI中文支持网
TI专业的中文技术问题搜集分享网站

LAUNCHXL-CC1310: CC1310如何在等待无线接收的同时处理串口接收的数据

Part Number:LAUNCHXL-CC1310

无线接收配置参照nortos中的rfPacketRx例程,在无线未收到数据时一直处在接收状态,无法进入到下一步。此时串口有数据进来,要怎么处理?

Kevin Qiu1:

是的,RF_runCmd是阻塞的:

RF_EventMask RF_runCmd	(	RF_Handleh,
RF_Op *pOp,
RF_PriorityePri,
RF_CallbackpCb,
RF_EventMaskbmEvent)Runs synchronously an RF operation command or a chain of commands and returns the termination reason.This function appends an RF operation command or a chain of commands to the RF driver's command queue and then waits for it to complete. A command is completed if one of the termination events RF_EventLastCmdDone, RF_EventCmdCancelled, RF_EventCmdAborted, RF_EventCmdStopped occurred.This function is a combination of RF_postCmd() and RF_pendCmd(). All options and limitations for RF_postCmd() apply here as well.An application should always ensure that the command completed in the expected way and with an expected status code.Note
Calling context : Task
Parameters
h	Driver handle previously returned by RF_open()
pOp	Pointer to the RF operation command.
ePri	Priority of this RF command (used for arbitration in multi-client systems)
pCb	Callback function called during command execution and upon completion. If RF_runCmd() fails, no callback is made.
bmEvent	Bitmask of events that will trigger the callback or that can be pended on.
Returns
The relevant termination event.

可能需要再新建一个任务进行串口数据读写,参考:

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1043524/cc1310-how-to-modify-the-blocking-method-caused-by-rf_runcmd-to-non-blocking-mode-in-the-rfwakeonradiorx-routine

,

user6370980:

在while循环中已经建了串口读写任务,参照链接中RF_cmdPropRx.startTime += WOR_WAKE_UP_INTERVAL_RAT_TICKS(WOR_WAKEUPS_PER_SECOND);并不奏效,是我配置的问题吗,还是使用方法的问题?

,

Kevin Qiu1:

这不是任务,任务需要使用RTOS版本,你现在使用的是nortos

,

user6370980:

这样太过于麻烦,我试着用RF_postCmd,现在能实现边监听边处理串口的功能

,

Kevin Qiu1:

这样也可以,RF_postCmd是非阻塞的

赞(0)
未经允许不得转载:TI中文支持网 » LAUNCHXL-CC1310: CC1310如何在等待无线接收的同时处理串口接收的数据
分享到: 更多 (0)