From 7450a6583f37d7d61b9a4463000d18d4f11fa21e Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 26 Apr 2011 12:48:50 -0700 Subject: usrp: support for grand daughter board eeprom --- host/lib/usrp/usrp1/dboard_impl.cpp | 12 +++++++++++- host/lib/usrp/usrp1/usrp1_impl.hpp | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp/usrp1') diff --git a/host/lib/usrp/usrp1/dboard_impl.cpp b/host/lib/usrp/usrp1/dboard_impl.cpp index 02906fc45..df0bb6261 100644 --- a/host/lib/usrp/usrp1/dboard_impl.cpp +++ b/host/lib/usrp/usrp1/dboard_impl.cpp @@ -59,6 +59,7 @@ void usrp1_impl::dboard_init(void) //read the tx and rx dboard eeproms _rx_db_eeproms[dboard_slot].load(*_iface, get_rx_ee_addr(dboard_slot)); _tx_db_eeproms[dboard_slot].load(*_iface, get_tx_ee_addr(dboard_slot)); + _gdb_eeproms[dboard_slot].load(*_iface, get_tx_ee_addr(dboard_slot) ^ 5); //create a new dboard interface and manager _dboard_ifaces[dboard_slot] = make_dboard_iface( @@ -68,7 +69,7 @@ void usrp1_impl::dboard_init(void) _dboard_managers[dboard_slot] = dboard_manager::make( _rx_db_eeproms[dboard_slot].id, - _tx_db_eeproms[dboard_slot].id, + ((_gdb_eeproms[dboard_slot].id == dboard_id_t::none())? _tx_db_eeproms[dboard_slot] : _gdb_eeproms[dboard_slot]).id, _dboard_ifaces[dboard_slot] ); @@ -171,6 +172,10 @@ void usrp1_impl::tx_dboard_get(const wax::obj &key_, wax::obj &val, dboard_slot_ val = _tx_db_eeproms[dboard_slot]; return; + case DBOARD_PROP_GBOARD_EEPROM: + val = _gdb_eeproms[dboard_slot]; + return; + case DBOARD_PROP_DBOARD_IFACE: val = _dboard_ifaces[dboard_slot]; return; @@ -203,6 +208,11 @@ void usrp1_impl::tx_dboard_set(const wax::obj &key, const wax::obj &val, dboard_ _tx_db_eeproms[dboard_slot].store(*_iface, get_tx_ee_addr(dboard_slot)); return; + case DBOARD_PROP_GBOARD_EEPROM: + _gdb_eeproms[dboard_slot] = val.as(); + _gdb_eeproms[dboard_slot].store(*_iface, get_tx_ee_addr(dboard_slot) ^ 5); + return; + default: UHD_THROW_PROP_SET_ERROR(); } } diff --git a/host/lib/usrp/usrp1/usrp1_impl.hpp b/host/lib/usrp/usrp1/usrp1_impl.hpp index 9755c466d..f53894b29 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.hpp +++ b/host/lib/usrp/usrp1/usrp1_impl.hpp @@ -175,7 +175,7 @@ private: uhd::dict _rx_dboard_proxies; //tx dboard functions and settings - uhd::dict _tx_db_eeproms; + uhd::dict _tx_db_eeproms, _gdb_eeproms; void tx_dboard_get(const wax::obj &, wax::obj &, dboard_slot_t); void tx_dboard_set(const wax::obj &, const wax::obj &, dboard_slot_t); uhd::dict _tx_dboard_proxies; -- cgit v1.2.3 From 1e7227319cdf9098c6ddf344ad5bbd2c82ca2cda Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 27 Apr 2011 13:17:19 -0700 Subject: usrp1: the rx mux was reversed (fixed multi-channel rx) --- host/lib/usrp/usrp1/mboard_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host/lib/usrp/usrp1') diff --git a/host/lib/usrp/usrp1/mboard_impl.cpp b/host/lib/usrp/usrp1/mboard_impl.cpp index 4e2fad6e5..870956568 100644 --- a/host/lib/usrp/usrp1/mboard_impl.cpp +++ b/host/lib/usrp/usrp1/mboard_impl.cpp @@ -80,7 +80,7 @@ static boost::uint32_t calc_rx_mux( //calculate the channel flags int channel_flags = 0; size_t num_reals = 0, num_quads = 0; - BOOST_FOREACH(const subdev_spec_pair_t &pair, subdev_spec){ + BOOST_FOREACH(const subdev_spec_pair_t &pair, uhd::reversed(subdev_spec)){ wax::obj dboard = mboard[named_prop_t(MBOARD_PROP_RX_DBOARD, pair.db_name)]; wax::obj subdev = dboard[named_prop_t(DBOARD_PROP_SUBDEV, pair.sd_name)]; subdev_conn_t conn = subdev[SUBDEV_PROP_CONNECTION].as(); -- cgit v1.2.3 From caff65d7e140d6340cef6ccd64ef250a735c09f9 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 27 Apr 2011 19:12:53 -0700 Subject: usrp1: fix for tx under remainder conditions The remainder was accidentally lost because the offset to the buffer was not propagated outside of the commit function. --- host/lib/usrp/usrp1/io_impl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/lib/usrp/usrp1') diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp index b3268298e..8fb639c4a 100644 --- a/host/lib/usrp/usrp1/io_impl.cpp +++ b/host/lib/usrp/usrp1/io_impl.cpp @@ -180,6 +180,9 @@ void usrp1_impl::io_impl::commit_send_buff( //commit the current buffer curr.buff->commit(num_bytes_to_commit); + + //store the next buffer for the next call + curr_buff = next; } /*! @@ -216,9 +219,6 @@ bool usrp1_impl::io_impl::get_send_buffs( //make a new managed buffer with the offset buffs buffs[0] = omsb.get_new(curr_buff, next_buff); - //store the next buffer for the next call - curr_buff = next_buff; - return true; } -- cgit v1.2.3