cc2538-rf: Simplified get_channel

This commit is contained in:
kkrentz 2018-08-02 05:46:34 -07:00
parent 34f697adf7
commit 9f78836219

View File

@ -154,10 +154,7 @@ PROCESS(cc2538_rf_process, "cc2538 RF driver");
static uint8_t
get_channel()
{
uint8_t chan = REG(RFCORE_XREG_FREQCTRL) & RFCORE_XREG_FREQCTRL_FREQ;
return (chan - CC2538_RF_CHANNEL_MIN) / CC2538_RF_CHANNEL_SPACING
+ CC2538_RF_CHANNEL_MIN;
return rf_channel;
}
/*---------------------------------------------------------------------------*/
/**