From 2926439e1ee593a055307704258aa361140de316 Mon Sep 17 00:00:00 2001 From: Trung N Tran Date: Tue, 28 Nov 2017 22:52:26 -0800 Subject: legacy_compat: extend radio index and radio slot We need more radio index and radio slot for N310. --- host/lib/rfnoc/legacy_compat.cpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'host/lib') 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 -- cgit v1.2.3