diff options
Diffstat (limited to 'host/lib/usrp/usrp_e100')
-rw-r--r-- | host/lib/usrp/usrp_e100/clock_ctrl.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e100/dboard_iface.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e100/fpga_downloader.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e100/mboard_impl.cpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e100/usrp_e100_iface.cpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e100/usrp_e100_impl.cpp | 6 |
6 files changed, 13 insertions, 13 deletions
diff --git a/host/lib/usrp/usrp_e100/clock_ctrl.cpp b/host/lib/usrp/usrp_e100/clock_ctrl.cpp index 6128894cc..b4ddcd271 100644 --- a/host/lib/usrp/usrp_e100/clock_ctrl.cpp +++ b/host/lib/usrp/usrp_e100/clock_ctrl.cpp @@ -158,7 +158,7 @@ static clock_settings_type get_clock_settings(double rate){ } } - throw std::runtime_error(str(boost::format( + throw uhd::value_error(str(boost::format( "USRP-E100 clock control: could not calculate settings for clock rate %fMHz" ) % (rate/1e6))); } diff --git a/host/lib/usrp/usrp_e100/dboard_iface.cpp b/host/lib/usrp/usrp_e100/dboard_iface.cpp index ee6ca3933..ee1b852bf 100644 --- a/host/lib/usrp/usrp_e100/dboard_iface.cpp +++ b/host/lib/usrp/usrp_e100/dboard_iface.cpp @@ -235,7 +235,7 @@ static boost::uint32_t unit_to_otw_spi_dev(dboard_iface::unit_t unit){ case dboard_iface::UNIT_TX: return UE_SPI_SS_TX_DB; case dboard_iface::UNIT_RX: return UE_SPI_SS_RX_DB; } - throw std::invalid_argument("unknown unit type"); + UHD_THROW_INVALID_CODE_PATH(); } void usrp_e100_dboard_iface::write_spi( diff --git a/host/lib/usrp/usrp_e100/fpga_downloader.cpp b/host/lib/usrp/usrp_e100/fpga_downloader.cpp index 9836cbc02..95665da83 100644 --- a/host/lib/usrp/usrp_e100/fpga_downloader.cpp +++ b/host/lib/usrp/usrp_e100/fpga_downloader.cpp @@ -87,7 +87,7 @@ gpio::gpio(unsigned int gpio_num, gpio_direction pin_direction) std::fstream export_file; export_file.open("/sys/class/gpio/export", std::ios::out); - if (not export_file.is_open()) throw std::runtime_error( + if (not export_file.is_open()) throw uhd::os_error( "Failed to open gpio export file." ); @@ -211,7 +211,7 @@ static void send_file_to_fpga(const std::string &file_name, gpio &error, gpio &d std::ifstream bitstream; bitstream.open(file_name.c_str(), std::ios::binary); - if (!bitstream.is_open()) throw std::runtime_error( + if (!bitstream.is_open()) throw uhd::os_error( "Coult not open the file: " + file_name ); diff --git a/host/lib/usrp/usrp_e100/mboard_impl.cpp b/host/lib/usrp/usrp_e100/mboard_impl.cpp index 07476bd6c..cec4fd0ad 100644 --- a/host/lib/usrp/usrp_e100/mboard_impl.cpp +++ b/host/lib/usrp/usrp_e100/mboard_impl.cpp @@ -17,9 +17,9 @@ #include "usrp_e100_impl.hpp" #include "usrp_e100_regs.hpp" +#include <uhd/exception.hpp> #include <uhd/usrp/dsp_utils.hpp> #include <uhd/usrp/misc_utils.hpp> -#include <uhd/exception.hpp> #include <uhd/usrp/mboard_props.hpp> #include <boost/bind.hpp> #include <iostream> @@ -53,7 +53,7 @@ void usrp_e100_impl::update_clock_config(void){ switch(_clock_config.pps_polarity){ case clock_config_t::PPS_POS: pps_flags |= UE_FLAG_TIME64_PPS_POSEDGE; break; case clock_config_t::PPS_NEG: pps_flags |= UE_FLAG_TIME64_PPS_NEGEDGE; break; - default: throw std::runtime_error("unhandled clock configuration pps polarity"); + default: throw uhd::value_error("unhandled clock configuration pps polarity"); } //set the pps flags @@ -64,7 +64,7 @@ void usrp_e100_impl::update_clock_config(void){ case clock_config_t::REF_AUTO: _clock_ctrl->use_auto_ref(); break; case clock_config_t::REF_INT: _clock_ctrl->use_internal_ref(); break; case clock_config_t::REF_SMA: _clock_ctrl->use_auto_ref(); break; - default: throw std::runtime_error("unhandled clock configuration ref source"); + default: throw uhd::value_error("unhandled clock configuration ref source"); } } diff --git a/host/lib/usrp/usrp_e100/usrp_e100_iface.cpp b/host/lib/usrp/usrp_e100/usrp_e100_iface.cpp index 687008df8..076ec2fd6 100644 --- a/host/lib/usrp/usrp_e100/usrp_e100_iface.cpp +++ b/host/lib/usrp/usrp_e100/usrp_e100_iface.cpp @@ -37,7 +37,7 @@ class i2c_dev_iface : public i2c_iface{ public: i2c_dev_iface(const std::string &node){ if ((_node_fd = ::open(node.c_str(), O_RDWR)) < 0){ - throw std::runtime_error("Failed to open " + node); + throw uhd::io_error("Failed to open " + node); } } @@ -106,7 +106,7 @@ public: { //open the device node and check file descriptor if ((_node_fd = ::open(node.c_str(), O_RDWR)) < 0){ - throw std::runtime_error("Failed to open " + node); + throw uhd::io_error("Failed to open " + node); } //very first thing, reset all the wishbone, always do first! @@ -127,7 +127,7 @@ public: boost::mutex::scoped_lock lock(_ctrl_mutex); if (::ioctl(_node_fd, request, mem) < 0){ - throw std::runtime_error(str( + throw uhd::os_error(str( boost::format("ioctl failed with request %d") % request )); } diff --git a/host/lib/usrp/usrp_e100/usrp_e100_impl.cpp b/host/lib/usrp/usrp_e100/usrp_e100_impl.cpp index d4404fc88..1385688e0 100644 --- a/host/lib/usrp/usrp_e100/usrp_e100_impl.cpp +++ b/host/lib/usrp/usrp_e100/usrp_e100_impl.cpp @@ -1,5 +1,5 @@ // -// Copyright 2010 Ettus Research LLC +// Copyright 2010-2011 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -103,7 +103,7 @@ static device::sptr usrp_e100_make(const device_addr_t &device_addr){ size_t fpga_hash = 0; { std::ifstream file(usrp_e100_fpga_image.c_str()); - if (not file.good()) throw std::runtime_error( + if (not file.good()) throw uhd::io_error( "cannot open fpga file for read: " + usrp_e100_fpga_image ); do{ @@ -132,7 +132,7 @@ static device::sptr usrp_e100_make(const device_addr_t &device_addr){ //check that the compatibility is correct fpga_compat_num = iface->peek16(UE_REG_MISC_COMPAT); if (fpga_compat_num != USRP_E_COMPAT_NUM){ - throw std::runtime_error(str(boost::format( + throw uhd::runtime_error(str(boost::format( "Expected fpga compatibility number 0x%x, but got 0x%x:\n" "The fpga build is not compatible with the host code build." ) % USRP_E_COMPAT_NUM % fpga_compat_num)); |