diff options
author | Vidush <vidush.vishwanath@ettus.com> | 2018-05-16 14:27:26 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-06-06 14:58:45 -0700 |
commit | 4461cda3a5dd074f6e5fbb09868a60b818e6c4f1 (patch) | |
tree | f80f7ddfac007b547c0c2b2fbd038fe22a10d1f9 /host/lib/usrp/x300 | |
parent | cc6121e0ac40a45a6c8d34147cda07b652648705 (diff) | |
download | uhd-4461cda3a5dd074f6e5fbb09868a60b818e6c4f1.tar.gz uhd-4461cda3a5dd074f6e5fbb09868a60b818e6c4f1.tar.bz2 uhd-4461cda3a5dd074f6e5fbb09868a60b818e6c4f1.zip |
X300_radio_ctrl_impl: Add SAFE_CALL to Destructor
Diffstat (limited to 'host/lib/usrp/x300')
-rw-r--r-- | host/lib/usrp/x300/x300_radio_ctrl_impl.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp index 453522249..aca4a5f00 100644 --- a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp +++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp @@ -12,6 +12,7 @@ #include <uhd/rfnoc/node_ctrl_base.hpp> #include <uhd/transport/chdr.hpp> #include <uhd/utils/math.hpp> +#include <uhd/utils/safe_call.hpp> #include <uhdlib/rfnoc/wb_iface_adapter.hpp> #include <uhdlib/usrp/cores/gpio_atr_3000.hpp> #include <uhdlib/usrp/common/apply_corrections.hpp> @@ -166,24 +167,27 @@ UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR(x300_radio_ctrl) x300_radio_ctrl_impl::~x300_radio_ctrl_impl() { - // Tear down our part of the tree: - _tree->remove(fs_path("rx_codecs" / _radio_slot)); - _tree->remove(fs_path("tx_codecs" / _radio_slot)); - _tree->remove(_root_path / "rx_fe_corrections"); - _tree->remove(_root_path / "tx_fe_corrections"); - if (_radio_type==PRIMARY) { - for(const gpio_atr::gpio_attr_map_t::value_type attr: gpio_atr::gpio_attr_map) { - _tree->remove(fs_path("gpio") / "FP0" / attr.second); + UHD_SAFE_CALL( + // Tear down our part of the tree: + _tree->remove(fs_path("rx_codecs" / _radio_slot)); + _tree->remove(fs_path("tx_codecs" / _radio_slot)); + _tree->remove(_root_path / "rx_fe_corrections"); + _tree->remove(_root_path / "tx_fe_corrections"); + if (_radio_type==PRIMARY) { + for(const gpio_atr::gpio_attr_map_t::value_type attr: gpio_atr::gpio_attr_map) { + _tree->remove(fs_path("gpio") / "FP0" / attr.second); + } } - } - // Reset peripherals - if (_radio_type==PRIMARY) { - _regs->misc_outs_reg.set(radio_regmap_t::misc_outs_reg_t::ADC_RESET, 1); - _regs->misc_outs_reg.set(radio_regmap_t::misc_outs_reg_t::DAC_RESET_N, 0); - } - _regs->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::DAC_ENABLED, 0); - _regs->misc_outs_reg.flush(); + // Reset peripherals + if (_radio_type==PRIMARY) { + _regs->misc_outs_reg.set(radio_regmap_t::misc_outs_reg_t::ADC_RESET, 1); + _regs->misc_outs_reg.set(radio_regmap_t::misc_outs_reg_t::DAC_RESET_N, 0); + } + _regs->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::DAC_ENABLED, 0); + _regs->misc_outs_reg.flush(); + ) + } /**************************************************************************** |