完善资料让更多小伙伴认识你,还能领取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. |
|
|
|
只有小组成员才能发言,加入小组>>
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
690 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
604 浏览 1 评论
对于多级放大电路板,在PCB布局中,电源摆放的位置应该注意什么?
1059 浏览 1 评论
749 浏览 0 评论
普中科技F28335开发板每次上电复位后数码管都会显示,如何熄灭它?
527 浏览 1 评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
170浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
130浏览 14评论
在使用3254进行录音的时候出现一个奇怪的现象,右声道有吱吱声,请教一下,是否是什么寄存器设置存在问题?
129浏览 13评论
TLV320芯片内部自带数字滤波功能,请问linein进来的模拟信号是否是先经过ADC的超采样?
125浏览 12评论
GD32F303RCT6配置PA4 ADC引脚,将PA2代替key功能,PA2连接时无法实现预期功能,为什么?
59浏览 10评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 15:08 , Processed in 0.781748 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号