aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard_eeprom.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-05-02 04:28:50 +0000
committerJosh Blum <josh@joshknows.com>2010-05-02 04:28:50 +0000
commit6ec2883fcd3e0b2765c63f2e96e155d52248bf89 (patch)
tree123181b29494d3c26ad96f9df65a718def9a65d8 /host/lib/usrp/dboard_eeprom.cpp
parent3a8577aeb3c76dce0d0dcf0c9c7ce8d9aaf0a1d8 (diff)
parentbe97b68ba230e16b513e5a0310aded49f4b2dcb4 (diff)
downloaduhd-6ec2883fcd3e0b2765c63f2e96e155d52248bf89.tar.gz
uhd-6ec2883fcd3e0b2765c63f2e96e155d52248bf89.tar.bz2
uhd-6ec2883fcd3e0b2765c63f2e96e155d52248bf89.zip
Merge branch 'master' of git@ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/lib/usrp/dboard_eeprom.cpp')
-rw-r--r--host/lib/usrp/dboard_eeprom.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/host/lib/usrp/dboard_eeprom.cpp b/host/lib/usrp/dboard_eeprom.cpp
index 54e7a4fd9..fa3631948 100644
--- a/host/lib/usrp/dboard_eeprom.cpp
+++ b/host/lib/usrp/dboard_eeprom.cpp
@@ -80,19 +80,20 @@ dboard_eeprom_t::dboard_eeprom_t(const byte_vector_t &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) ;
+ id = dboard_id_t::from_uint16(0
+ | (boost::uint16_t(bytes[DB_EEPROM_ID_LSB]) << 0)
+ | (boost::uint16_t(bytes[DB_EEPROM_ID_MSB]) << 8)
+ );
}catch(const uhd::assert_error &){
- id = dboard_id::NONE;
+ id = dboard_id_t::none();
}
}
byte_vector_t dboard_eeprom_t::get_eeprom_bytes(void){
byte_vector_t bytes(DB_EEPROM_CLEN, 0); //defaults to all zeros
bytes[DB_EEPROM_MAGIC] = DB_EEPROM_MAGIC_VALUE;
- bytes[DB_EEPROM_ID_LSB] = boost::uint8_t(id >> 0);
- bytes[DB_EEPROM_ID_MSB] = boost::uint8_t(id >> 8);
+ bytes[DB_EEPROM_ID_LSB] = boost::uint8_t(id.to_uint16() >> 0);
+ bytes[DB_EEPROM_ID_MSB] = boost::uint8_t(id.to_uint16() >> 8);
bytes[DB_EEPROM_CHKSUM] = checksum(bytes);
return bytes;
}