diff options
author | Josh Blum <josh@joshknows.com> | 2010-11-04 20:38:25 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-11-04 20:38:25 -0700 |
commit | fcf9f6ba329df2538286aabe20dd26628fc4ab43 (patch) | |
tree | e59345a0e9513ae7595a79602b4a688343541089 /host/lib/usrp/usrp2/clock_ctrl.cpp | |
parent | 7c36bc7b7456225f613887a2b84ebefac2b1c208 (diff) | |
download | uhd-fcf9f6ba329df2538286aabe20dd26628fc4ab43.tar.gz uhd-fcf9f6ba329df2538286aabe20dd26628fc4ab43.tar.bz2 uhd-fcf9f6ba329df2538286aabe20dd26628fc4ab43.zip |
usrp2: move mboard eeprom instance into iface to the clock control can access it
Diffstat (limited to 'host/lib/usrp/usrp2/clock_ctrl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/clock_ctrl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp2/clock_ctrl.cpp b/host/lib/usrp/usrp2/clock_ctrl.cpp index 1e1c9b7b8..232f3b32a 100644 --- a/host/lib/usrp/usrp2/clock_ctrl.cpp +++ b/host/lib/usrp/usrp2/clock_ctrl.cpp @@ -20,6 +20,7 @@ #include "usrp2_regs.hpp" //spi slave constants #include <uhd/utils/assert.hpp> #include <boost/cstdint.hpp> +#include <boost/lexical_cast.hpp> #include <iostream> using namespace uhd; @@ -83,8 +84,8 @@ public: } void enable_mimo_clock_out(bool enb){ - //FIXME TODO put this revision read in a common place - boost::uint8_t rev_hi = _iface->read_eeprom(USRP2_I2C_ADDR_MBOARD, USRP2_EE_MBOARD_REV_MSB, 1).at(0); + boost::uint16_t rev = boost::lexical_cast<boost::uint16_t>(_iface->mb_eeprom["rev"]); + boost::uint8_t rev_hi = boost::uint8_t(rev >> 8); //calculate the low and high dividers size_t divider = size_t(this->get_master_clock_rate()/10e6); |