Replace transceiver_mode dependent MAX2837 mode management with max2837_mode() -> max2837_set_mode() calls.

This commit is contained in:
Jared Boone
2013-09-06 22:50:04 -07:00
parent a367f84d15
commit b89f43e97e

View File

@ -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;