From 4e4d8556a43f7f054e760b66749c034aa5741a7f Mon Sep 17 00:00:00 2001 From: Philip Balister Date: Tue, 20 Apr 2010 15:53:07 +0000 Subject: Initialize data array to help show when reads fail. Report return value from ioctl --- host/apps/omap_debug/usrp-e-i2c.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'host/apps/omap_debug') 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