diff options
author | Josh Blum <josh@joshknows.com> | 2010-04-26 12:19:00 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-04-26 12:19:00 -0700 |
commit | f040d79d256bcdfcd931ab93e00b66f6af881a14 (patch) | |
tree | 0bb82963278a64caaa04b1c5360f0d3e48059d42 /host/lib/usrp/dboard | |
parent | 15befa19de40fb82f30d71bf21a767e7d8054ba1 (diff) | |
parent | 1217b8d67c3bef98195836fe10ab39576642b340 (diff) | |
download | uhd-f040d79d256bcdfcd931ab93e00b66f6af881a14.tar.gz uhd-f040d79d256bcdfcd931ab93e00b66f6af881a14.tar.bz2 uhd-f040d79d256bcdfcd931ab93e00b66f6af881a14.zip |
Merge branch 'eeprom' of git@ettus.sourcerepo.com:ettus/uhdpriv
Diffstat (limited to 'host/lib/usrp/dboard')
-rw-r--r-- | host/lib/usrp/dboard/db_basic_and_lf.cpp | 12 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_rfx.cpp | 14 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_xcvr2450.cpp | 15 |
3 files changed, 20 insertions, 21 deletions
diff --git a/host/lib/usrp/dboard/db_basic_and_lf.cpp b/host/lib/usrp/dboard/db_basic_and_lf.cpp index aad2398d8..c7b841efb 100644 --- a/host/lib/usrp/dboard/db_basic_and_lf.cpp +++ b/host/lib/usrp/dboard/db_basic_and_lf.cpp @@ -153,6 +153,8 @@ void basic_rx::rx_get(const wax::obj &key_, wax::obj &val){ case SUBDEV_PROP_USE_LO_OFFSET: val = false; return; + + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -174,9 +176,7 @@ void basic_rx::rx_set(const wax::obj &key_, const wax::obj &val){ case SUBDEV_PROP_FREQ: return; // it wont do you much good, but you can set it - default: throw std::runtime_error(str(boost::format( - "Error: trying to set read-only property on %s subdev" - ) % dboard_id::to_string(get_rx_id()))); + default: UHD_THROW_PROP_READ_ONLY(); } } @@ -248,6 +248,8 @@ void basic_tx::tx_get(const wax::obj &key_, wax::obj &val){ case SUBDEV_PROP_USE_LO_OFFSET: val = false; return; + + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -269,8 +271,6 @@ void basic_tx::tx_set(const wax::obj &key_, const wax::obj &val){ case SUBDEV_PROP_FREQ: return; // it wont do you much good, but you can set it - default: throw std::runtime_error(str(boost::format( - "Error: trying to set read-only property on %s subdev" - ) % dboard_id::to_string(get_tx_id()))); + default: UHD_THROW_PROP_READ_ONLY(); } } diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp index 76b2c6d7a..49ec9412c 100644 --- a/host/lib/usrp/dboard/db_rfx.cpp +++ b/host/lib/usrp/dboard/db_rfx.cpp @@ -396,6 +396,8 @@ void rfx_xcvr::rx_get(const wax::obj &key_, wax::obj &val){ case SUBDEV_PROP_USE_LO_OFFSET: val = false; return; + + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -419,10 +421,7 @@ void rfx_xcvr::rx_set(const wax::obj &key_, const wax::obj &val){ set_rx_ant(val.as<std::string>()); return; - default: - throw std::runtime_error(str(boost::format( - "Error: trying to set read-only property on %s subdev" - ) % dboard_id::to_string(get_rx_id()))); + default: UHD_THROW_PROP_READ_ONLY(); } } @@ -486,6 +485,8 @@ void rfx_xcvr::tx_get(const wax::obj &key_, wax::obj &val){ case SUBDEV_PROP_USE_LO_OFFSET: val = true; return; + + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -509,9 +510,6 @@ void rfx_xcvr::tx_set(const wax::obj &key_, const wax::obj &val){ ASSERT_THROW(val.as<std::string>() == "TX/RX"); return; - default: - throw std::runtime_error(str(boost::format( - "Error: trying to set read-only property on %s subdev" - ) % dboard_id::to_string(get_tx_id()))); + default: UHD_THROW_PROP_READ_ONLY(); } } diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index 2c2843d3a..2052511f8 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -352,7 +352,8 @@ static max2829_regs_t::tx_baseband_gain_t gain_to_tx_bb_reg(float &gain){ gain = 5; return max2829_regs_t::TX_BASEBAND_GAIN_5DB; } - ASSERT_THROW(false); + BOOST_THROW_EXCEPTION(std::runtime_error("should not get here")); + return max2829_regs_t::TX_BASEBAND_GAIN_0DB; } /*! @@ -474,6 +475,8 @@ void xcvr2450::rx_get(const wax::obj &key_, wax::obj &val){ case SUBDEV_PROP_USE_LO_OFFSET: val = false; return; + + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -496,9 +499,7 @@ void xcvr2450::rx_set(const wax::obj &key_, const wax::obj &val){ this->set_rx_ant(val.as<std::string>()); return; - default: throw std::runtime_error(str(boost::format( - "Error: trying to set read-only property on %s subdev" - ) % dboard_id::to_string(get_rx_id()))); + default: UHD_THROW_PROP_READ_ONLY(); } } @@ -564,6 +565,8 @@ void xcvr2450::tx_get(const wax::obj &key_, wax::obj &val){ case SUBDEV_PROP_USE_LO_OFFSET: val = false; return; + + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -586,8 +589,6 @@ void xcvr2450::tx_set(const wax::obj &key_, const wax::obj &val){ this->set_tx_ant(val.as<std::string>()); return; - default: throw std::runtime_error(str(boost::format( - "Error: trying to set read-only property on %s subdev" - ) % dboard_id::to_string(get_tx_id()))); + default: UHD_THROW_PROP_READ_ONLY(); } } |