diff options
author | Philip Balister <philip@opensdr.com> | 2010-04-20 15:53:07 +0000 |
---|---|---|
committer | Philip Balister <philip@opensdr.com> | 2010-04-20 15:53:07 +0000 |
commit | 4e4d8556a43f7f054e760b66749c034aa5741a7f (patch) | |
tree | 9d713b707ec0aafb0a008b2a0ce717a7127f16df /host | |
parent | c05fc634407741ce202cccc0781e937897c51361 (diff) | |
download | uhd-4e4d8556a43f7f054e760b66749c034aa5741a7f.tar.gz uhd-4e4d8556a43f7f054e760b66749c034aa5741a7f.tar.bz2 uhd-4e4d8556a43f7f054e760b66749c034aa5741a7f.zip |
Initialize data array to help show when reads fail. Report return value
from ioctl
Diffstat (limited to 'host')
-rw-r--r-- | host/apps/omap_debug/usrp-e-i2c.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/host/apps/omap_debug/usrp-e-i2c.c b/host/apps/omap_debug/usrp-e-i2c.c index c8fcc3f98..575430f84 100644 --- a/host/apps/omap_debug/usrp-e-i2c.c +++ b/host/apps/omap_debug/usrp-e-i2c.c @@ -49,6 +49,10 @@ int main(int argc, char *argv[]) i2c_msg->addr = address; i2c_msg->len = count; + for (i = 0; i < count; i++) { + i2c_msg->data[i] = i; + } + if (direction) { // Write @@ -63,6 +67,7 @@ int main(int argc, char *argv[]) // Read ret = ioctl(fp, USRP_E_I2C_READ, i2c_msg); + printf("Return value from i2c_read ioctl: %d\n", ret); printf("Ioctl: %d Data read :", ret); for (i=0; i<count; i++) { |