diff options
| author | Martin Braun <martin.braun@ettus.com> | 2017-06-06 11:28:20 -0700 | 
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:03:59 -0800 | 
| commit | 59330ad80cfdd0694fd856c10ca84378dc54ff12 (patch) | |
| tree | e67ecf705e7681eee202fc272947293fd603b36e /host | |
| parent | b14bc217e9598578bef89707ca4febc11e0f4290 (diff) | |
| download | uhd-59330ad80cfdd0694fd856c10ca84378dc54ff12.tar.gz uhd-59330ad80cfdd0694fd856c10ca84378dc54ff12.tar.bz2 uhd-59330ad80cfdd0694fd856c10ca84378dc54ff12.zip | |
eiscat: Make use of known number of dboards
Diffstat (limited to 'host')
| -rw-r--r-- | host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp | 20 | ||||
| -rw-r--r-- | host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp | 4 | 
2 files changed, 24 insertions, 0 deletions
| diff --git a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp index ea1e31102..35260150f 100644 --- a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp +++ b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp @@ -476,6 +476,20 @@ void eiscat_radio_ctrl_impl::set_rpc_client(  ) {      _rpcc = rpcc;      _block_args = block_args; +    auto dboard_info = +        _rpcc->request<std::vector<std::map<std::string, std::string>>>( +                "get_dboard_info" +        ); +    _num_dboards = dboard_info.size(); +    UHD_LOG_DEBUG("EISCAT", "Using " << _num_dboards << " daughterboards."); +    if (_num_dboards == 1) { +        UHD_LOG_WARNING("EISCAT", +            "Found 1 dboard, expected 2 for optimal operation." +        ); +    } else if (_num_dboards > 2) { +        UHD_LOG_ERROR("EISCAT", "Detected too many dboards: " << _num_dboards); +        throw uhd::runtime_error("Too many dboards detected."); +    }      UHD_LOG_INFO(          "EISCAT", @@ -684,12 +698,18 @@ void eiscat_radio_ctrl_impl::enable_counter(bool enable)  bool eiscat_radio_ctrl_impl::assert_adcs_deframers()  { +    if (_num_dboards == 1) { +        return _rpcc->request_with_token<bool>("db_0_init_adcs_and_deframers"); +    }      return _rpcc->request_with_token<bool>("db_0_init_adcs_and_deframers")          and _rpcc->request_with_token<bool>("db_1_init_adcs_and_deframers");  }  bool eiscat_radio_ctrl_impl::assert_deframer_status()  { +    if (_num_dboards == 1) { +        return _rpcc->request_with_token<bool>("db_0_check_deframer_status"); +    }      return _rpcc->request_with_token<bool>("db_0_check_deframer_status")          and _rpcc->request_with_token<bool>("db_1_check_deframer_status");  } diff --git a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp index 2da01ed03..6210c8aab 100644 --- a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp +++ b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp @@ -276,6 +276,10 @@ private:       */      size_t _num_ports; +    //! Running with 1 dboard is theoretically possible; thus, store the +    // number of active dboards. +    size_t _num_dboards = 0; +      //! Additional block args; gets set during set_rpc_client()      uhd::device_addr_t _block_args; | 
