diff options
author | Trung N Tran <trung.tran@ettus.com> | 2017-11-28 22:52:26 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:05:07 -0800 |
commit | 2926439e1ee593a055307704258aa361140de316 (patch) | |
tree | 844c5335d6ad65f8f68ae9de697d13c8ab3c77f4 /host/lib | |
parent | d2594f9a92c2ee2797ee54d428914c316ab377b6 (diff) | |
download | uhd-2926439e1ee593a055307704258aa361140de316.tar.gz uhd-2926439e1ee593a055307704258aa361140de316.tar.bz2 uhd-2926439e1ee593a055307704258aa361140de316.zip |
legacy_compat: extend radio index and radio slot
We need more radio index and radio slot for N310.
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/rfnoc/legacy_compat.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp index f6b065dcb..137909d8b 100644 --- a/host/lib/rfnoc/legacy_compat.cpp +++ b/host/lib/rfnoc/legacy_compat.cpp @@ -408,12 +408,38 @@ private: // methods ***********************************************************************/ std::string get_slot_name(const size_t radio_index) { - return (radio_index == 0) ? "A" : "B"; + if (radio_index == 0){ + return "A"; + }else if (radio_index == 1){ + return "B"; + }else if (radio_index == 2){ + return "C"; + }else if (radio_index == 3){ + return "D"; + }else{ + throw uhd::index_error(str( + boost::format("[legacy_compat]: radio index %u out of supported range.") + % radio_index + )); + } } size_t get_radio_index(const std::string slot_name) { - return (slot_name == "A") ? 0 : 1; + if (slot_name == "A"){ + return 0; + }else if (slot_name == "B"){ + return 1; + }else if (slot_name == "C"){ + return 2; + }else if (slot_name == "D"){ + return 3; + }else { + throw uhd::key_error(str( + boost::format("[legacy_compat]: radio slot name %s out of supported range.") + % slot_name + )); + } } template <typename block_type> |