From ac5d3a02a095d1ba8d3089d2d4b5d05b32346cc8 Mon Sep 17 00:00:00 2001 From: Jason Abele Date: Tue, 11 Oct 2011 19:08:09 -0700 Subject: Fix for unitialized eeprom --- host/lib/usrp/usrp2/usrp2_iface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp/usrp2') 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(mb_eeprom["hardware"])){ + std::string hw = mb_eeprom["hardware"]; + if (hw.empty()) return USRP_NXXX; + switch (boost::lexical_cast(hw)){ case 0x0300: case 0x0301: return USRP2_REV3; case 0x0400: return USRP2_REV4; -- cgit v1.2.3