无线接收配置参照nortos中的rfPacketRx例程,在无线未收到数据时一直处在接收状态,无法进入到下一步。此时串口有数据进来,要怎么处理?
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.
无线接收配置参照nortos中的rfPacketRx例程,在无线未收到数据时一直处在接收状态,无法进入到下一步。此时串口有数据进来,要怎么处理?
是的,RF_runCmd是阻塞的:
RF_EventMask RF_runCmd ( RF_Handle h, RF_Op * pOp, RF_Priority ePri, RF_Callback pCb, RF_EventMask bmEvent ) 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.
可能需要再新建一个任务进行串口数据读写,参考:
在while循环中已经建了串口读写任务,参照链接中RF_cmdPropRx.startTime += WOR_WAKE_UP_INTERVAL_RAT_TICKS(WOR_WAKEUPS_PER_SECOND);并不奏效,是我配置的问题吗,还是使用方法的问题?
这不是任务,任务需要使用RTOS版本,你现在使用的是nortos
这样太过于麻烦,我试着用RF_postCmd,现在能实现边监听边处理串口的功能