diff options
Diffstat (limited to 'host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp')
-rw-r--r-- | host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp index a753a447c..4bf9b7573 100644 --- a/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp +++ b/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp @@ -204,6 +204,7 @@ void neon_radio_ctrl_impl::set_tx_antenna( % ant )); } + radio_ctrl_impl::set_tx_antenna(ant, chan); // We can't actually set the TX antenna, so let's stop here. } @@ -224,8 +225,8 @@ void neon_radio_ctrl_impl::set_rx_antenna( UHD_LOG_TRACE(unique_id(), "Setting RX antenna to " << ant << " for chan " << chan); - _set_atr_bits(chan, radio_ctrl_impl::get_rx_frequency(chan), ant); radio_ctrl_impl::set_rx_antenna(ant, chan); + _set_atr_bits(chan); } double neon_radio_ctrl_impl::set_tx_frequency( @@ -236,14 +237,14 @@ double neon_radio_ctrl_impl::set_tx_frequency( "set_tx_frequency(f=" << freq << ", chan=" << chan << ")"); std::lock_guard<std::mutex> l(_set_lock); + double clipped_freq = uhd::clip(freq, AD9361_TX_MIN_FREQ, AD9361_TX_MAX_FREQ); + double coerced_freq = _ad9361->tune( get_which_ad9361_chain(TX_DIRECTION, chan), - freq); + clipped_freq); radio_ctrl_impl::set_tx_frequency(coerced_freq, chan); - // Antenna settings - auto ant = get_tx_antenna(chan); // Front-end switching - _set_atr_bits(chan, freq, ant); + _set_atr_bits(chan); return coerced_freq; } @@ -256,14 +257,14 @@ double neon_radio_ctrl_impl::set_rx_frequency( "set_rx_frequency(f=" << freq << ", chan=" << chan << ")"); std::lock_guard<std::mutex> l(_set_lock); + double clipped_freq = uhd::clip(freq, AD9361_RX_MIN_FREQ, AD9361_RX_MAX_FREQ); + double coerced_freq = _ad9361->tune( get_which_ad9361_chain(RX_DIRECTION, chan), - freq); + clipped_freq); radio_ctrl_impl::set_rx_frequency(coerced_freq, chan); - // Antenna settings - auto ant = get_rx_antenna(chan); // Front-end switching - _set_atr_bits(chan, coerced_freq, ant); + _set_atr_bits(chan); return coerced_freq; } @@ -434,13 +435,13 @@ bool neon_radio_ctrl_impl::get_lo_lock_status( } void neon_radio_ctrl_impl::_set_atr_bits( - const size_t chan, - const double freq, - const std::string &ant + const size_t chan ) { - - const uint32_t rx_regs = _get_rx_switches(chan, freq, ant); - const uint32_t tx_regs = _get_tx_switches(chan, freq); + const auto rx_freq = radio_ctrl_impl::get_rx_frequency(chan); + const auto tx_freq = radio_ctrl_impl::get_tx_frequency(chan); + const auto rx_ant = radio_ctrl_impl::get_rx_antenna(chan); + const uint32_t rx_regs = _get_rx_switches(chan, rx_freq, rx_ant); + const uint32_t tx_regs = _get_tx_switches(chan, tx_freq); const uint32_t idle_regs = TX_AMP_OFF << TX_AMP_SHIFT | TRX1_SW_TX_HB << TRX_SW_SHIFT | TX_SW2_LB_80 << TX_SW2_SHIFT | @@ -456,7 +457,7 @@ void neon_radio_ctrl_impl::_set_atr_bits( // The LED signal names are reversed, but are consistent with the schematic const int idle_led = 0; - const bool is_txrx = ant == "TX/RX"; + const bool is_txrx = rx_ant == "TX/RX"; const int rx_led = 1 << TRX_LED_GRN_SHIFT; const int tx_led = 1 << TX_LED_RED_SHIFT; const int txrx_led = 1 << RX_LED_GRN_SHIFT; |