diff options
author | Josh Blum <josh@joshknows.com> | 2011-06-10 15:23:24 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-06-10 15:23:24 -0700 |
commit | 09cf8eb16444b0c744b47b39b077f9d0fbb09886 (patch) | |
tree | 6f7c381b2736860378838e5bab6baeef8f602e13 /host/lib/usrp/usrp1 | |
parent | e709e4d36516f4459cc08c46ae6eea1e12feb70b (diff) | |
download | uhd-09cf8eb16444b0c744b47b39b077f9d0fbb09886.tar.gz uhd-09cf8eb16444b0c744b47b39b077f9d0fbb09886.tar.bz2 uhd-09cf8eb16444b0c744b47b39b077f9d0fbb09886.zip |
uhd: added more SAFE_CALL macros to hardware wrapper dtors
And removed the calls on the sptr resets (not needed now).
Diffstat (limited to 'host/lib/usrp/usrp1')
-rw-r--r-- | host/lib/usrp/usrp1/codec_ctrl.cpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/usrp1/usrp1_impl.cpp | 18 |
2 files changed, 7 insertions, 17 deletions
diff --git a/host/lib/usrp/usrp1/codec_ctrl.cpp b/host/lib/usrp/usrp1/codec_ctrl.cpp index 64a93ede5..448135185 100644 --- a/host/lib/usrp/usrp1/codec_ctrl.cpp +++ b/host/lib/usrp/usrp1/codec_ctrl.cpp @@ -20,6 +20,7 @@ #include "clock_ctrl.hpp" #include "ad9862_regs.hpp" #include <uhd/utils/log.hpp> +#include <uhd/utils/safe_call.hpp> #include <uhd/types/dict.hpp> #include <uhd/exception.hpp> #include <uhd/utils/algorithm.hpp> @@ -140,8 +141,7 @@ usrp1_codec_ctrl_impl::usrp1_codec_ctrl_impl(usrp1_iface::sptr iface, this->send_reg(34); } -usrp1_codec_ctrl_impl::~usrp1_codec_ctrl_impl(void) -{ +usrp1_codec_ctrl_impl::~usrp1_codec_ctrl_impl(void){UHD_SAFE_CALL( //set aux dacs to zero this->write_aux_dac(AUX_DAC_A, 0); this->write_aux_dac(AUX_DAC_B, 0); @@ -154,7 +154,7 @@ usrp1_codec_ctrl_impl::~usrp1_codec_ctrl_impl(void) _ad9862_regs.tx_digital_pd = 1; _ad9862_regs.tx_analog_pd = ad9862_regs_t::TX_ANALOG_PD_BOTH; this->send_reg(8); -} +)} /*********************************************************************** * Codec Control Gain Control Methods diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp index b1fa986d1..83ff8ebe2 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.cpp +++ b/host/lib/usrp/usrp1/usrp1_impl.cpp @@ -208,20 +208,10 @@ usrp1_impl::usrp1_impl(uhd::transport::usb_zero_copy::sptr data_transport, this->mboard_set(MBOARD_PROP_TX_SUBDEV_SPEC, subdev_spec_t()); } -usrp1_impl::~usrp1_impl(void){ - UHD_SAFE_CALL(this->enable_rx(false);) - UHD_SAFE_CALL(this->enable_tx(false);) - //Safely destruct all RAII objects in a device. - //This prevents the mboard deconstructor from throwing, - //which allows the device to be safely deconstructed. - BOOST_FOREACH(dboard_slot_t slot, _dboard_slots){ - UHD_SAFE_CALL(_dboard_managers[slot].reset();) - UHD_SAFE_CALL(_dboard_ifaces[slot].reset();) - UHD_SAFE_CALL(_codec_ctrls[slot].reset();) - } - UHD_SAFE_CALL(_clock_ctrl.reset();) - UHD_SAFE_CALL(_io_impl.reset();) -} +usrp1_impl::~usrp1_impl(void){UHD_SAFE_CALL( + this->enable_rx(false); + this->enable_tx(false); +)} bool usrp1_impl::recv_async_msg(uhd::async_metadata_t &, double timeout){ //dummy fill-in for the recv_async_msg |