diff options
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/device.cpp | 4 | ||||
-rw-r--r-- | host/lib/transport/convert_types.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_basic_and_lf.cpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_rfx.cpp | 10 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_xcvr2450.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/dboard_eeprom.cpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/dboard_manager.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/dboard_impl.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/dsp_impl.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/mboard_impl.cpp | 18 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_iface.cpp | 16 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.cpp | 2 |
12 files changed, 40 insertions, 40 deletions
diff --git a/host/lib/device.cpp b/host/lib/device.cpp index 0197a6232..706f64951 100644 --- a/host/lib/device.cpp +++ b/host/lib/device.cpp @@ -132,8 +132,8 @@ device::sptr device::make(const device_addr_t &hint, size_t which){ //try to find an existing device try{ - ASSERT_THROW(hash_to_device.has_key(dev_hash)); - ASSERT_THROW(not hash_to_device[dev_hash].expired()); + UHD_ASSERT_THROW(hash_to_device.has_key(dev_hash)); + UHD_ASSERT_THROW(not hash_to_device[dev_hash].expired()); return hash_to_device[dev_hash].lock(); } //create and register a new device diff --git a/host/lib/transport/convert_types.cpp b/host/lib/transport/convert_types.cpp index d7602c049..8c3d6b17a 100644 --- a/host/lib/transport/convert_types.cpp +++ b/host/lib/transport/convert_types.cpp @@ -110,7 +110,7 @@ void transport::convert_io_type_to_otw_type( size_t num_samps ){ //all we handle for now: - ASSERT_THROW(otw_type.width == 16 and otw_type.byteorder == otw_type_t::BO_BIG_ENDIAN); + UHD_ASSERT_THROW(otw_type.width == 16 and otw_type.byteorder == otw_type_t::BO_BIG_ENDIAN); switch(io_type.tid){ case io_type_t::COMPLEX_FLOAT32: @@ -130,7 +130,7 @@ void transport::convert_otw_type_to_io_type( size_t num_samps ){ //all we handle for now: - ASSERT_THROW(otw_type.width == 16 and otw_type.byteorder == otw_type_t::BO_BIG_ENDIAN); + UHD_ASSERT_THROW(otw_type.width == 16 and otw_type.byteorder == otw_type_t::BO_BIG_ENDIAN); switch(io_type.tid){ case io_type_t::COMPLEX_FLOAT32: diff --git a/host/lib/usrp/dboard/db_basic_and_lf.cpp b/host/lib/usrp/dboard/db_basic_and_lf.cpp index c7b841efb..4ca2ef9b1 100644 --- a/host/lib/usrp/dboard/db_basic_and_lf.cpp +++ b/host/lib/usrp/dboard/db_basic_and_lf.cpp @@ -166,11 +166,11 @@ void basic_rx::rx_set(const wax::obj &key_, const wax::obj &val){ switch(key.as<subdev_prop_t>()){ case SUBDEV_PROP_GAIN: - ASSERT_THROW(val.as<float>() == float(0)); + UHD_ASSERT_THROW(val.as<float>() == float(0)); return; case SUBDEV_PROP_ANTENNA: - ASSERT_THROW(val.as<std::string>() == std::string("")); + UHD_ASSERT_THROW(val.as<std::string>() == std::string("")); return; case SUBDEV_PROP_FREQ: @@ -261,11 +261,11 @@ void basic_tx::tx_set(const wax::obj &key_, const wax::obj &val){ switch(key.as<subdev_prop_t>()){ case SUBDEV_PROP_GAIN: - ASSERT_THROW(val.as<float>() == float(0)); + UHD_ASSERT_THROW(val.as<float>() == float(0)); return; case SUBDEV_PROP_ANTENNA: - ASSERT_THROW(val.as<std::string>() == std::string("")); + UHD_ASSERT_THROW(val.as<std::string>() == std::string("")); return; case SUBDEV_PROP_FREQ: diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp index 49ec9412c..14879dbed 100644 --- a/host/lib/usrp/dboard/db_rfx.cpp +++ b/host/lib/usrp/dboard/db_rfx.cpp @@ -192,7 +192,7 @@ void rfx_xcvr::set_tx_lo_freq(double freq){ void rfx_xcvr::set_rx_ant(const std::string &ant){ //validate input - ASSERT_THROW(ant == "TX/RX" or ant == "RX2"); + UHD_ASSERT_THROW(ant == "TX/RX" or ant == "RX2"); //set the rx atr regs that change with antenna setting this->get_iface()->set_atr_reg( @@ -350,12 +350,12 @@ void rfx_xcvr::rx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_GAIN: - ASSERT_THROW(name == "PGA0"); + UHD_ASSERT_THROW(name == "PGA0"); val = _rx_pga0_gain; return; case SUBDEV_PROP_GAIN_RANGE: - ASSERT_THROW(name == "PGA0"); + UHD_ASSERT_THROW(name == "PGA0"); val = gain_range_t(0, _max_rx_pga0_gain, float(0.022)); return; @@ -413,7 +413,7 @@ void rfx_xcvr::rx_set(const wax::obj &key_, const wax::obj &val){ return; case SUBDEV_PROP_GAIN: - ASSERT_THROW(name == "PGA0"); + UHD_ASSERT_THROW(name == "PGA0"); set_rx_pga0_gain(val.as<float>()); return; @@ -507,7 +507,7 @@ void rfx_xcvr::tx_set(const wax::obj &key_, const wax::obj &val){ case SUBDEV_PROP_ANTENNA: //its always set to tx/rx, so we only allow this value - ASSERT_THROW(val.as<std::string>() == "TX/RX"); + UHD_ASSERT_THROW(val.as<std::string>() == "TX/RX"); return; 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 2052511f8..576d08848 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -395,7 +395,7 @@ void xcvr2450::set_tx_gain(float gain, const std::string &name){ _max2829_regs.tx_baseband_gain = gain_to_tx_bb_reg(gain); send_reg(0x9); } - else ASSERT_THROW(false); + else UHD_ASSERT_THROW(false); _tx_gains[name] = gain; } @@ -409,7 +409,7 @@ void xcvr2450::set_rx_gain(float gain, const std::string &name){ _max2829_regs.rx_lna_gain = gain_to_rx_lna_reg(gain); send_reg(0xB); } - else ASSERT_THROW(false); + else UHD_ASSERT_THROW(false); _rx_gains[name] = gain; } diff --git a/host/lib/usrp/dboard_eeprom.cpp b/host/lib/usrp/dboard_eeprom.cpp index 00236c337..1404ed1e6 100644 --- a/host/lib/usrp/dboard_eeprom.cpp +++ b/host/lib/usrp/dboard_eeprom.cpp @@ -77,9 +77,9 @@ dboard_eeprom_t::dboard_eeprom_t(const byte_vector_t &bytes){ } } try{ - ASSERT_THROW(bytes.size() >= DB_EEPROM_CLEN); - ASSERT_THROW(bytes[DB_EEPROM_MAGIC] == DB_EEPROM_MAGIC_VALUE); - ASSERT_THROW(bytes[DB_EEPROM_CHKSUM] == checksum(bytes)); + UHD_ASSERT_THROW(bytes.size() >= DB_EEPROM_CLEN); + UHD_ASSERT_THROW(bytes[DB_EEPROM_MAGIC] == DB_EEPROM_MAGIC_VALUE); + UHD_ASSERT_THROW(bytes[DB_EEPROM_CHKSUM] == checksum(bytes)); id = \ (boost::uint16_t(bytes[DB_EEPROM_ID_LSB]) << 0) | (boost::uint16_t(bytes[DB_EEPROM_ID_MSB]) << 8) ; diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp index 34b635934..390c1d3c9 100644 --- a/host/lib/usrp/dboard_manager.cpp +++ b/host/lib/usrp/dboard_manager.cpp @@ -206,7 +206,7 @@ dboard_manager_impl::dboard_manager_impl( //make xcvr subdevs (make one subdev for both rx and tx dboards) if (rx_dboard_ctor == tx_dboard_ctor){ - ASSERT_THROW(rx_subdevs == tx_subdevs); + UHD_ASSERT_THROW(rx_subdevs == tx_subdevs); BOOST_FOREACH(const std::string &subdev, rx_subdevs){ dboard_base::sptr xcvr_dboard = rx_dboard_ctor( dboard_base::ctor_args_t(subdev, iface, rx_dboard_id, tx_dboard_id) diff --git a/host/lib/usrp/usrp2/dboard_impl.cpp b/host/lib/usrp/usrp2/dboard_impl.cpp index a68ae240e..226a7950d 100644 --- a/host/lib/usrp/usrp2/dboard_impl.cpp +++ b/host/lib/usrp/usrp2/dboard_impl.cpp @@ -66,7 +66,7 @@ void usrp2_impl::dboard_init(void){ void usrp2_impl::update_rx_mux_config(void){ //calculate the rx mux boost::uint32_t rx_mux = 0; - ASSERT_THROW(_rx_subdevs_in_use.size() == 1); + UHD_ASSERT_THROW(_rx_subdevs_in_use.size() == 1); wax::obj rx_subdev = _dboard_manager->get_rx_subdev(_rx_subdevs_in_use.at(0)); std::cout << "Using: " << rx_subdev[SUBDEV_PROP_NAME].as<std::string>() << std::endl; if (rx_subdev[SUBDEV_PROP_QUADRATURE].as<bool>()){ @@ -84,7 +84,7 @@ void usrp2_impl::update_rx_mux_config(void){ void usrp2_impl::update_tx_mux_config(void){ //calculate the tx mux boost::uint32_t tx_mux = 0x10; - ASSERT_THROW(_tx_subdevs_in_use.size() == 1); + UHD_ASSERT_THROW(_tx_subdevs_in_use.size() == 1); wax::obj tx_subdev = _dboard_manager->get_tx_subdev(_tx_subdevs_in_use.at(0)); std::cout << "Using: " << tx_subdev[SUBDEV_PROP_NAME].as<std::string>() << std::endl; if (tx_subdev[SUBDEV_PROP_IQ_SWAPPED].as<bool>()){ diff --git a/host/lib/usrp/usrp2/dsp_impl.cpp b/host/lib/usrp/usrp2/dsp_impl.cpp index 379276f7d..84c50ac0d 100644 --- a/host/lib/usrp/usrp2/dsp_impl.cpp +++ b/host/lib/usrp/usrp2/dsp_impl.cpp @@ -40,7 +40,7 @@ template <class T> T log2(T num){ * DDC Helper Methods **********************************************************************/ static boost::uint32_t calculate_freq_word_and_update_actual_freq(double &freq, double clock_freq){ - ASSERT_THROW(std::abs(freq) < clock_freq/2.0); + UHD_ASSERT_THROW(std::abs(freq) < clock_freq/2.0); static const double scale_factor = std::pow(2.0, 32); //calculate the freq register word diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index 2c185ec53..684cf245d 100644 --- a/host/lib/usrp/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp @@ -152,7 +152,7 @@ void usrp2_impl::issue_ddc_stream_cmd(const stream_cmd_t &stream_cmd){ //send and recv usrp2_ctrl_data_t in_data = _iface->ctrl_send_and_recv(out_data); - ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_GOT_THAT_STREAM_COMMAND_DUDE); + UHD_ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_GOT_THAT_STREAM_COMMAND_DUDE); } /*********************************************************************** @@ -171,7 +171,7 @@ void usrp2_impl::mboard_get(const wax::obj &key_, wax::obj &val){ //send and recv usrp2_ctrl_data_t in_data = _iface->ctrl_send_and_recv(out_data); - ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_THIS_IS_MY_MAC_ADDR_DUDE); + UHD_ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_THIS_IS_MY_MAC_ADDR_DUDE); //extract the address val = mac_addr_t::from_bytes(in_data.data.mac_addr).to_string(); @@ -185,7 +185,7 @@ void usrp2_impl::mboard_get(const wax::obj &key_, wax::obj &val){ //send and recv usrp2_ctrl_data_t in_data = _iface->ctrl_send_and_recv(out_data); - ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_THIS_IS_MY_IP_ADDR_DUDE); + UHD_ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_THIS_IS_MY_IP_ADDR_DUDE); //extract the address val = boost::asio::ip::address_v4(ntohl(in_data.data.ip_addr)).to_string(); @@ -209,7 +209,7 @@ void usrp2_impl::mboard_get(const wax::obj &key_, wax::obj &val){ return; case MBOARD_PROP_RX_DBOARD: - ASSERT_THROW(name == ""); + UHD_ASSERT_THROW(name == ""); val = _rx_dboard_proxy->get_link(); return; @@ -218,7 +218,7 @@ void usrp2_impl::mboard_get(const wax::obj &key_, wax::obj &val){ return; case MBOARD_PROP_TX_DBOARD: - ASSERT_THROW(name == ""); + UHD_ASSERT_THROW(name == ""); val = _tx_dboard_proxy->get_link(); return; @@ -227,7 +227,7 @@ void usrp2_impl::mboard_get(const wax::obj &key_, wax::obj &val){ return; case MBOARD_PROP_RX_DSP: - ASSERT_THROW(name == ""); + UHD_ASSERT_THROW(name == ""); val = _rx_dsp_proxy->get_link(); return; @@ -236,7 +236,7 @@ void usrp2_impl::mboard_get(const wax::obj &key_, wax::obj &val){ return; case MBOARD_PROP_TX_DSP: - ASSERT_THROW(name == ""); + UHD_ASSERT_THROW(name == ""); val = _tx_dsp_proxy->get_link(); return; @@ -267,7 +267,7 @@ void usrp2_impl::mboard_set(const wax::obj &key, const wax::obj &val){ //send and recv usrp2_ctrl_data_t in_data = _iface->ctrl_send_and_recv(out_data); - ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_THIS_IS_MY_MAC_ADDR_DUDE); + UHD_ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_THIS_IS_MY_MAC_ADDR_DUDE); return; } @@ -279,7 +279,7 @@ void usrp2_impl::mboard_set(const wax::obj &key, const wax::obj &val){ //send and recv usrp2_ctrl_data_t in_data = _iface->ctrl_send_and_recv(out_data); - ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_THIS_IS_MY_IP_ADDR_DUDE); + UHD_ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_THIS_IS_MY_IP_ADDR_DUDE); return; } } diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp index 27b6f8907..5bca2c95b 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.cpp +++ b/host/lib/usrp/usrp2/usrp2_iface.cpp @@ -86,7 +86,7 @@ public: //send and recv usrp2_ctrl_data_t in_data = this->ctrl_send_and_recv(out_data); - ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_OMG_TRANSACTED_SPI_DUDE); + UHD_ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_OMG_TRANSACTED_SPI_DUDE); return ntohl(out_data.data.spi_args.data); } @@ -102,14 +102,14 @@ public: out_data.data.i2c_args.bytes = buf.size(); //limitation of i2c transaction size - ASSERT_THROW(buf.size() <= sizeof(out_data.data.i2c_args.data)); + UHD_ASSERT_THROW(buf.size() <= sizeof(out_data.data.i2c_args.data)); //copy in the data std::copy(buf.begin(), buf.end(), out_data.data.i2c_args.data); //send and recv usrp2_ctrl_data_t in_data = this->ctrl_send_and_recv(out_data); - ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_COOL_IM_DONE_I2C_WRITE_DUDE); + UHD_ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_COOL_IM_DONE_I2C_WRITE_DUDE); } byte_vector_t read_i2c(boost::uint8_t addr, size_t num_bytes){ @@ -120,12 +120,12 @@ public: out_data.data.i2c_args.bytes = num_bytes; //limitation of i2c transaction size - ASSERT_THROW(num_bytes <= sizeof(out_data.data.i2c_args.data)); + UHD_ASSERT_THROW(num_bytes <= sizeof(out_data.data.i2c_args.data)); //send and recv usrp2_ctrl_data_t in_data = this->ctrl_send_and_recv(out_data); - ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_HERES_THE_I2C_DATA_DUDE); - ASSERT_THROW(in_data.data.i2c_args.addr = num_bytes); + UHD_ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_HERES_THE_I2C_DATA_DUDE); + UHD_ASSERT_THROW(in_data.data.i2c_args.addr = num_bytes); //copy out the data byte_vector_t result(num_bytes); @@ -193,7 +193,7 @@ private: //send and recv usrp2_ctrl_data_t in_data = this->ctrl_send_and_recv(out_data); - ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_OMG_POKED_REGISTER_SO_BAD_DUDE); + UHD_ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_OMG_POKED_REGISTER_SO_BAD_DUDE); } template <class T> T peek(boost::uint32_t addr){ @@ -205,7 +205,7 @@ private: //send and recv usrp2_ctrl_data_t in_data = this->ctrl_send_and_recv(out_data); - ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_WOAH_I_DEFINITELY_PEEKED_IT_DUDE); + UHD_ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_WOAH_I_DEFINITELY_PEEKED_IT_DUDE); return T(ntohl(out_data.data.poke_args.data)); } diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index 11ad812e1..d9b2248ff 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -186,7 +186,7 @@ void usrp2_impl::get(const wax::obj &key_, wax::obj &val){ return; case DEVICE_PROP_MBOARD: - ASSERT_THROW(name == ""); + UHD_ASSERT_THROW(name == ""); val = _mboard_proxy->get_link(); return; |