完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛扫一扫,分享给好友
|
ti工程师,您好。我正在修改WakeOnRadioRx的文件,我是在接受到数据后,有WOR模式切换到直接接受模式。我的思路如下:
void wor_wakeup(void) [ /* Request access to the radio */ rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams); /* Set frequency */ RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, &callback, 0); /* Save the current radio time */ RF_cmdPropRxSniff.startTime = RF_getCurrentTime(); while(1) [ packetLength = 0x0; /* Set next wakeup time in the future */ RF_cmdPropRxSniff.startTime += WOR_WAKE_UP_INTERVAL_RAT_TICKS(WOR_WAKEUPS_PER_SECOND)*3; //RF_cmdPropRxSniff.endTime = RF_cmdPropRxSniff.startTime + 160000; /* Schedule RX */ RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRxSniff, RF_PriorityNormal, &callback, RF_EventRxEntryDone); /* Log RX_SNIFF status */ switch(RF_cmdPropRxSniff.status) [ case PROP_DONE_IDLE://0x3407 /* Idle based on RSSI */ worStatistics.doneIdle++; // PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2)); break; case PROP_DONE_IDLETIMEOUT://0x3409 /* Idle based on PQT */ worStatistics.doneIdleTimeout++; //.endTrigger.triggerType = TRIG_ABSTIME,//TRIG_REL_START,//TRIG_NOW TRIG_NEVER TRIG_REL_START // PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2)); break; case PROP_DONE_RXTIMEOUT://0x3401 /* Got valid preamble on the air, but did not find sync word */ worStatistics.doneRxTimeout++; // PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2)); break; case PROP_DONE_OK:// 0x3400 /* Received packet */ worStatistics.doneOk++; process_wakeupData(); if(packetLength) [ PIN_setOutputValue(ledPinHandle, Board_PIN_LED0,!PIN_getOutputValue(Board_PIN_LED0)); RF_close(rfHandle); return; ] else [ PIN_setOutputValue(ledPinHandle, Board_PIN_LED0,!PIN_getOutputValue(Board_PIN_LED0)); ] break; default: /* Unhandled status */ break; ]; ] ] 发现程序一直卡在了RF_close(rfHandle); 请问这个是啥原因。另外是否有办法可以让WOR直接切换到一直接受模式,超时后再切换到WOR模式。谢谢! |
|
相关推荐
2个回答
|
|
|
1. 就别切了,直接把那个sniff的startTrigger改为TRIG_NOW, 基本也就是直接接收了.
startTrigger.triggerType = TRIG_NOW; 把如下的语句屏蔽掉 /* Set next wakeup time in the future */ RF_cmdPropRxSniff.startTime += WOR_WAKE_UP_INTERVAL_RAT_TICKS(WOR_WAKEUPS_PER_SECOND)*3; void wor_wakeup(void) [ /* Request access to the radio */ rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams); /* Set frequency */ RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, &callback, 0); /* Save the current radio time */ RF_cmdPropRxSniff.startTrigger.triggerType = TRIG_NOW; RF_cmdPropRxSniff.startTime = RF_getCurrentTime(); while(1) [ packetLength = 0x0; /* Set next wakeup time in the future */ //RF_cmdPropRxSniff.startTime += WOR_WAKE_UP_INTERVAL_RAT_TICKS(WOR_WAKEUPS_PER_SECOND)*3; //RF_cmdPropRxSniff.endTime = RF_cmdPropRxSniff.startTime + 160000; /* Schedule RX */ RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRxSniff, RF_PriorityNormal, &callback, RF_EventRxEntryDone); /* Log RX_SNIFF status */ switch(RF_cmdPropRxSniff.status) [ case PROP_DONE_IDLE://0x3407 /* Idle based on RSSI */ worStatistics.doneIdle++; // PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2)); break; case PROP_DONE_IDLETIMEOUT://0x3409 /* Idle based on PQT */ worStatistics.doneIdleTimeout++; //.endTrigger.triggerType = TRIG_ABSTIME,//TRIG_REL_START,//TRIG_NOW TRIG_NEVER TRIG_REL_START // PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2)); break; case PROP_DONE_RXTIMEOUT://0x3401 /* Got valid preamble on the air, but did not find sync word */ worStatistics.doneRxTimeout++; // PIN_setOutputValue(ledPinHandle, Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2)); break; case PROP_DONE_OK:// 0x3400 /* Received packet */ worStatistics.doneOk++; process_wakeupData(); if(packetLength) [ PIN_setOutputValue(ledPinHandle, Board_PIN_LED0,!PIN_getOutputValue(Board_PIN_LED0)); RF_close(rfHandle); return; ] else [ PIN_setOutputValue(ledPinHandle, Board_PIN_LED0,!PIN_getOutputValue(Board_PIN_LED0)); ] break; default: /* Unhandled status */ break; ]; ] ] |
|
|
|
|
|
另外一种考量是使用RF_control(rfHandle, RF_CTRL_UPDATE_SETUP_CMD, NULL) 命令
可以借鉴如下做法: Use the command RF_control(..,RF_CTRL_UPDATE_SETUP_CMD, ..) after defining the new frequency. RF_CTRL_UPDATE_SETUP_CMD signals that the change will take effect immidiate on the next power cycle. The flow could look like this: RF_open Start RX (using freq. 1) Exit Rx RF_control (RF_CTRL_UPDATE_SETUP_CMD) - change to freq.2 Go to standby or atleast power down RF core (either RF_yield or set inactivityTimeout) Start Rx (using freq. 2) Exit Rx RF_control (RF_CTRL_UPDATE_SETUP_CMD) - change to freq.1 Go to standby or atleast power down RF core (either RF_yield or set inactivityTimeout) Start Rx (using freq. 1) Exit Rx Driver documentation: http://dev.ti.com/tirex/content/simplelink_cc13x0_sdk_1_30_00_06/docs/tidrivers/doxygen/html/_r_f_8h.html Description of define RF_CTRL_UPDATE_SETUP_CMD : Setting this control notifies RF that the setup command is to be updated, so that RF will take proper actions when executing the next setup command. Note the updated setup command will take effect in the next power up cycle when RF executes the setup command. Prior to updating the setup command, user should make sure all pending commands have completed. |
|
|
|
|
只有小组成员才能发言,加入小组>>
553 浏览 0 评论
1616 浏览 0 评论
2049 浏览 0 评论
为啥BQ7693003DBTR芯片在和BQ769X0盒子通讯时收不到信号?
1516 浏览 0 评论
DSP 28027F 开发板 XDS100v2调试探针诊断日志显示了 Error -150 (SC_ERR_FTDI_FAIL)如何解决
1342 浏览 0 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
1759浏览 29评论
2786浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
1726浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
1637浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
1647浏览 13评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-3 02:57 , Processed in 0.533156 second(s), Total 47, Slave 40 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1957