summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/usrp1')
-rw-r--r--host/lib/usrp/usrp1/dboard_iface.cpp6
-rw-r--r--host/lib/usrp/usrp1/io_impl.cpp4
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp22
3 files changed, 24 insertions, 8 deletions
diff --git a/host/lib/usrp/usrp1/dboard_iface.cpp b/host/lib/usrp/usrp1/dboard_iface.cpp
index b2221e221..4791b55ce 100644
--- a/host/lib/usrp/usrp1/dboard_iface.cpp
+++ b/host/lib/usrp/usrp1/dboard_iface.cpp
@@ -49,8 +49,8 @@ public:
_codec = codec;
//init the clock rate shadows
- this->set_clock_rate(UNIT_RX, _clock->get_master_clock_freq());
- this->set_clock_rate(UNIT_TX, _clock->get_master_clock_freq());
+ this->set_clock_rate(UNIT_RX, this->get_clock_rates(UNIT_RX).front());
+ this->set_clock_rate(UNIT_TX, this->get_clock_rates(UNIT_TX).front());
}
~usrp1_dboard_iface()
@@ -134,7 +134,7 @@ void usrp1_dboard_iface::set_clock_rate(unit_t unit, double rate)
_clock_rates[unit] = rate;
if (unit == UNIT_RX && _rx_dboard_id == dbsrx_classic_id){
- size_t divider = size_t(rate/_clock->get_master_clock_freq());
+ size_t divider = size_t(_clock->get_master_clock_freq()/rate);
switch(_dboard_slot){
case usrp1_impl::DBOARD_SLOT_A:
_iface->poke32(FR_RX_A_REFCLK, (divider & 0x7f) | 0x80);
diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp
index 920c47b30..92e8bc20a 100644
--- a/host/lib/usrp/usrp1/io_impl.cpp
+++ b/host/lib/usrp/usrp1/io_impl.cpp
@@ -189,7 +189,7 @@ bool usrp1_impl::io_impl::check_underrun(usrp_ctrl::sptr ctrl_if,
if (ret < 0)
std::cerr << "USRP: underrun check failed" << std::endl;
if (underrun)
- std::cerr << "Uu";
+ std::cerr << "U" << std::flush;
send_state.underrun_poll_samp_count = 0;
}
@@ -289,7 +289,7 @@ bool usrp1_impl::io_impl::check_overrun(usrp_ctrl::sptr ctrl_if,
if (ret < 0)
std::cerr << "USRP: overrrun check failed" << std::endl;
if (overrun)
- std::cerr << "Oo";
+ std::cerr << "O" << std::flush;
recv_state.overrun_poll_samp_count = 0;
}
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index 8ad148274..a18b697fb 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -21,6 +21,8 @@
#include "usrp_spi_defs.h"
#include <uhd/transport/usb_control.hpp>
#include <uhd/usrp/device_props.hpp>
+#include <uhd/usrp/mboard_props.hpp>
+#include <uhd/utils/warning.hpp>
#include <uhd/utils/assert.hpp>
#include <uhd/utils/static.hpp>
#include <uhd/utils/images.hpp>
@@ -54,9 +56,19 @@ static device_addrs_t usrp1_find(const device_addr_t &hint)
if (hint.has_key("type") and hint["type"] != "usrp1") return usrp1_addrs;
//extract the firmware path for the USRP1
- std::string usrp1_fw_image = find_image_path(
- hint.has_key("fw")? hint["fw"] : "usrp1_fw.ihx"
- );
+ std::string usrp1_fw_image;
+ try{
+ usrp1_fw_image = find_image_path(
+ hint.has_key("fw")? hint["fw"] : "usrp1_fw.ihx"
+ );
+ }
+ catch(const std::exception &e){
+ uhd::print_warning(
+ "Could not locate USRP1 firmware.\n"
+ "Please install the images package.\n"
+ );
+ return usrp1_addrs;
+ }
std::cout << "USRP1 firmware image: " << usrp1_fw_image << std::endl;
boost::uint16_t vid = hint.has_key("uninit") ? FX2_VENDOR_ID : USRP1_VENDOR_ID;
@@ -173,6 +185,10 @@ usrp1_impl::usrp1_impl(uhd::transport::usb_zero_copy::sptr data_transport,
//turn on the transmitter
_ctrl_transport->usrp_tx_enable(true);
+
+ //init the subdev specs
+ this->mboard_set(MBOARD_PROP_RX_SUBDEV_SPEC, subdev_spec_t());
+ this->mboard_set(MBOARD_PROP_TX_SUBDEV_SPEC, subdev_spec_t());
}
usrp1_impl::~usrp1_impl(void){