Replace transceiver_mode dependent MAX2837 mode management with max2837_mode() -> max2837_set_mode() calls.
This commit is contained in:
@ -115,6 +115,7 @@ bool set_freq(uint32_t freq_mhz, uint32_t freq_hz)
|
|||||||
|
|
||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
|
const max2837_mode_t prior_max2837_mode = max2837_mode();
|
||||||
max2837_mode_standby();
|
max2837_mode_standby();
|
||||||
if(freq_mhz >= MIN_LP_FREQ_MHZ)
|
if(freq_mhz >= MIN_LP_FREQ_MHZ)
|
||||||
{
|
{
|
||||||
@ -171,10 +172,7 @@ bool set_freq(uint32_t freq_mhz, uint32_t freq_hz)
|
|||||||
/* Error freq_mhz too low */
|
/* Error freq_mhz too low */
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
if(transceiver_mode == TRANSCEIVER_MODE_RX)
|
max2837_set_mode(prior_max2837_mode);
|
||||||
max2837_mode_rx();
|
|
||||||
else if(transceiver_mode == TRANSCEIVER_MODE_TX)
|
|
||||||
max2837_mode_tx();
|
|
||||||
freq_mhz_cache = freq_mhz;
|
freq_mhz_cache = freq_mhz;
|
||||||
freq_hz_cache = freq_hz;
|
freq_hz_cache = freq_hz;
|
||||||
return success;
|
return success;
|
||||||
|
Reference in New Issue
Block a user