Other Parts Discussed in Thread: CC1310
I am starting with the rfPacketRx example, and would like to change the RX frequency based on a button press. I have created a function called setFrequency() that is called when the button is pressed. But the behavior I get is that the Rx frequency does not seem to change from the original setting that was called upon initialization. What am I doing wrong?
uint32_t RxFrequencies[8] = {916000000, 916250000, 916500000, 916750000, 917000000, 917250000, 917500000, 917750000}; /***** Function definitions *****/ void setFrequency(uint8_t channel) { if(channel > sizeof(RxFrequencies)) channel = 0; uint32_t frequ = RxFrequencies[channel]; RF_cmdFs.frequency = frequ / 1000000; RF_cmdFs.fractFreq = (frequ % 1000000) * 0.065536; RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0); RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &callback, RF_EventRxEntryDone); // Initialize receive mode and callback }