From c30cbf651ba5efc734faa96c1b12a99b15b6e41e Mon Sep 17 00:00:00 2001 From: Thomas Tsou Date: Fri, 27 Aug 2010 12:22:42 -0700 Subject: usrp1: Disable i2c error messages unless debug is enabled Failed i2c operations can be normal under certain situations. Notably, write failures are used to detect unpopulated daughterboard slots. --- host/lib/usrp/usrp1/usrp1_iface.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'host') diff --git a/host/lib/usrp/usrp1/usrp1_iface.cpp b/host/lib/usrp/usrp1/usrp1_iface.cpp index 9d326d6bd..8756a21c9 100644 --- a/host/lib/usrp/usrp1/usrp1_iface.cpp +++ b/host/lib/usrp/usrp1/usrp1_iface.cpp @@ -122,7 +122,8 @@ public: buff, bytes.size()); - if (ret < 0) + // TODO throw and catch i2c failures during eeprom read + if (iface_debug && (ret < 0)) std::cerr << "USRP: failed i2c write: " << ret << std::endl; } @@ -137,7 +138,8 @@ public: buff, num_bytes); - if ((ret < 0) || (unsigned)ret < (num_bytes)) { + // TODO throw and catch i2c failures during eeprom read + if (iface_debug && ((ret < 0) || (unsigned)ret < (num_bytes))) { std::cerr << "USRP: failed i2c read: " << ret << std::endl; return byte_vector_t(num_bytes, 0xff); } -- cgit v1.2.3