summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1
diff options
context:
space:
mode:
authorThomas Tsou <ttsou@vt.edu>2010-08-27 12:22:42 -0700
committerThomas Tsou <ttsou@vt.edu>2010-08-27 12:27:47 -0700
commitc30cbf651ba5efc734faa96c1b12a99b15b6e41e (patch)
tree283f9a917a814d7ea1e427c3b6a1dc1e5c5c5da0 /host/lib/usrp/usrp1
parent1e1e70373943113b5339a7229219e3851af36561 (diff)
downloaduhd-c30cbf651ba5efc734faa96c1b12a99b15b6e41e.tar.gz
uhd-c30cbf651ba5efc734faa96c1b12a99b15b6e41e.tar.bz2
uhd-c30cbf651ba5efc734faa96c1b12a99b15b6e41e.zip
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.
Diffstat (limited to 'host/lib/usrp/usrp1')
-rw-r--r--host/lib/usrp/usrp1/usrp1_iface.cpp6
1 files changed, 4 insertions, 2 deletions
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);
}