diff options
Diffstat (limited to 'host/lib/include/uhdlib/rfnoc/radio_ctrl_impl.hpp')
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/radio_ctrl_impl.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/radio_ctrl_impl.hpp b/host/lib/include/uhdlib/rfnoc/radio_ctrl_impl.hpp index 62a268335..3858b6d84 100644 --- a/host/lib/include/uhdlib/rfnoc/radio_ctrl_impl.hpp +++ b/host/lib/include/uhdlib/rfnoc/radio_ctrl_impl.hpp @@ -194,11 +194,12 @@ protected: // TODO see what's protected and what's private inline bool _is_streamer_active(uhd::direction_t dir, const size_t chan) const { switch (dir) { case uhd::TX_DIRECTION: - return _tx_streamer_active.at(chan); + return chan < _tx_streamer_active.size() ? _tx_streamer_active.at(chan) : false; case uhd::RX_DIRECTION: - return _rx_streamer_active.at(chan); + return chan < _rx_streamer_active.size() ? _rx_streamer_active.at(chan) : false; case uhd::DX_DIRECTION: - return _rx_streamer_active.at(chan) and _tx_streamer_active.at(chan); + return (chan < _rx_streamer_active.size() and chan < _tx_streamer_active.size()) ? + _rx_streamer_active.at(chan) and _tx_streamer_active.at(chan) : false; default: return false; } @@ -211,6 +212,9 @@ protected: // TODO see what's protected and what's private std::mutex _mutex; + size_t _num_tx_channels; + size_t _num_rx_channels; + private: /************************************************************************ * Peripherals @@ -222,8 +226,7 @@ private: }; std::map<size_t, radio_perifs_t> _perifs; - size_t _num_tx_channels; - size_t _num_rx_channels; + // Cached values double _tick_rate; |