aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard_eeprom.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-05-03 10:47:27 -0700
committerJosh Blum <josh@joshknows.com>2010-05-03 10:47:27 -0700
commit48c636ec9d9287303bf5a223b2dd600545933237 (patch)
tree0ec0fb0d630528b52fdc4a2cf72969a4defbe8f5 /host/lib/usrp/dboard_eeprom.cpp
parent22b964a70a456c2fe9e3262668fd7e026e85b1a1 (diff)
parent4d5df2376b204afb724684d0d864ce0d93fe83fb (diff)
downloaduhd-48c636ec9d9287303bf5a223b2dd600545933237.tar.gz
uhd-48c636ec9d9287303bf5a223b2dd600545933237.tar.bz2
uhd-48c636ec9d9287303bf5a223b2dd600545933237.zip
Merge branch 'work' of git@ettus.sourcerepo.com:ettus/uhdpriv
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;
}