summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-06-10 15:23:24 -0700
committerJosh Blum <josh@joshknows.com>2011-06-10 15:23:24 -0700
commit09cf8eb16444b0c744b47b39b077f9d0fbb09886 (patch)
tree6f7c381b2736860378838e5bab6baeef8f602e13 /host/lib/usrp/usrp2
parente709e4d36516f4459cc08c46ae6eea1e12feb70b (diff)
downloaduhd-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/usrp2')
-rw-r--r--host/lib/usrp/usrp2/clock_ctrl.cpp5
-rw-r--r--host/lib/usrp/usrp2/codec_ctrl.cpp5
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp16
3 files changed, 10 insertions, 16 deletions
diff --git a/host/lib/usrp/usrp2/clock_ctrl.cpp b/host/lib/usrp/usrp2/clock_ctrl.cpp
index f1fdfb7cf..66c7a6c28 100644
--- a/host/lib/usrp/usrp2/clock_ctrl.cpp
+++ b/host/lib/usrp/usrp2/clock_ctrl.cpp
@@ -19,6 +19,7 @@
#include "ad9510_regs.hpp"
#include "usrp2_regs.hpp" //spi slave constants
#include "usrp2_clk_regs.hpp"
+#include <uhd/utils/safe_call.hpp>
#include <uhd/utils/assert_has.hpp>
#include <boost/cstdint.hpp>
#include <boost/lexical_cast.hpp>
@@ -77,7 +78,7 @@ public:
this->enable_test_clock(enb_test_clk);
}
- ~usrp2_clock_ctrl_impl(void){
+ ~usrp2_clock_ctrl_impl(void){UHD_SAFE_CALL(
//power down clock outputs
this->enable_external_ref(false);
this->enable_rx_dboard_clock(false);
@@ -86,7 +87,7 @@ public:
this->enable_adc_clock(false);
this->enable_mimo_clock_out(false);
this->enable_test_clock(false);
- }
+ )}
void enable_mimo_clock_out(bool enb){
//calculate the low and high dividers
diff --git a/host/lib/usrp/usrp2/codec_ctrl.cpp b/host/lib/usrp/usrp2/codec_ctrl.cpp
index 047195390..ee0ef9ceb 100644
--- a/host/lib/usrp/usrp2/codec_ctrl.cpp
+++ b/host/lib/usrp/usrp2/codec_ctrl.cpp
@@ -20,6 +20,7 @@
#include "ads62p44_regs.hpp"
#include "usrp2_regs.hpp"
#include <uhd/utils/log.hpp>
+#include <uhd/utils/safe_call.hpp>
#include <uhd/exception.hpp>
#include <boost/cstdint.hpp>
#include <boost/foreach.hpp>
@@ -95,7 +96,7 @@ public:
}
}
- ~usrp2_codec_ctrl_impl(void){
+ ~usrp2_codec_ctrl_impl(void){UHD_SAFE_CALL(
//power-down dac
_ad9777_regs.power_down_mode = 1;
this->send_ad9777_reg(0);
@@ -118,7 +119,7 @@ public:
case usrp2_iface::USRP_NXXX: break;
}
- }
+ )}
void set_tx_mod_mode(int mod_mode){
//set the sign of the frequency shift
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index bf1fd5cce..4a28ea9c4 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -176,18 +176,10 @@ usrp2_mboard_impl::usrp2_mboard_impl(
//------------------------------------------------------------------
}
-usrp2_mboard_impl::~usrp2_mboard_impl(void){
- //Safely destruct all RAII objects in an mboard.
- //This prevents the mboard deconstructor from throwing,
- //which allows the device to be safely deconstructed.
- UHD_SAFE_CALL(_iface->poke32(U2_REG_TX_CTRL_CYCLES_PER_UP, 0);)
- UHD_SAFE_CALL(_iface->poke32(U2_REG_TX_CTRL_PACKETS_PER_UP, 0);)
- UHD_SAFE_CALL(_dboard_manager.reset();)
- UHD_SAFE_CALL(_dboard_iface.reset();)
- UHD_SAFE_CALL(_codec_ctrl.reset();)
- UHD_SAFE_CALL(_clock_ctrl.reset();)
- UHD_SAFE_CALL(_gps_ctrl.reset();)
-}
+usrp2_mboard_impl::~usrp2_mboard_impl(void){UHD_SAFE_CALL(
+ _iface->poke32(U2_REG_TX_CTRL_CYCLES_PER_UP, 0);
+ _iface->poke32(U2_REG_TX_CTRL_PACKETS_PER_UP, 0);
+)}
/***********************************************************************
* Helper Methods