summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Abele <jason@ettus.com>2011-10-11 19:08:09 -0700
committerJosh Blum <josh@joshknows.com>2011-10-12 10:16:58 -0700
commitac5d3a02a095d1ba8d3089d2d4b5d05b32346cc8 (patch)
treedd854d8cf60f2c851d46f4998cbe6b663905565d
parent1a695f94849644773deda18f84a07ef1a206481b (diff)
downloaduhd-ac5d3a02a095d1ba8d3089d2d4b5d05b32346cc8.tar.gz
uhd-ac5d3a02a095d1ba8d3089d2d4b5d05b32346cc8.tar.bz2
uhd-ac5d3a02a095d1ba8d3089d2d4b5d05b32346cc8.zip
Fix for unitialized eeprom
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp
index 3c9e0ae0c..a26cedcc5 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.cpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.cpp
@@ -291,7 +291,9 @@ public:
}
rev_type get_rev(void){
- switch (boost::lexical_cast<boost::uint16_t>(mb_eeprom["hardware"])){
+ std::string hw = mb_eeprom["hardware"];
+ if (hw.empty()) return USRP_NXXX;
+ switch (boost::lexical_cast<boost::uint16_t>(hw)){
case 0x0300:
case 0x0301: return USRP2_REV3;
case 0x0400: return USRP2_REV4;