如题目,CC1310的rfCarrierWave例程,如何在运行中修改载波频率?例程中运行到RF_runCmd(rfHandle, (RF_Op*)&RF_cmdTxTest, RF_PriorityNormal, NULL, 0);之后就不再执行了?
Viki Shi:
要修改频率,一般做法是线cancel掉当前的RF command,然后进行修改。以下代码供参考:
Frq_Int = 0x0364; Frq_Fract = 0x0000;while (1) {RF_cmdFs.frequency = Frq_Int;RF_cmdFs.fractFreq = Frq_Fract;RF_cmdPropRadioDivSetup.centerFreq = Frq_Int;Frq_Int += 1;/* Set the frequency */RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);/* Enter RX mode and */RF_EventMask terminationReason = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx,RF_PriorityNormal, &callback,RF_EventRxEntryDone);while(!packetReceived);packetReceived = false; }