i2c: flip the msg flags for mraa_i2c_read_bytes_data
authorBrendan Le Foll <brendan.le.foll@intel.com>
Fri, 13 Mar 2015 16:01:59 +0000 (16:01 +0000)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Fri, 13 Mar 2015 16:02:04 +0000 (16:02 +0000)
Fixes 168.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
src/i2c/i2c.c

index 48590f9..edfd392 100644 (file)
@@ -207,11 +207,11 @@ mraa_i2c_read_bytes_data(mraa_i2c_context dev, uint8_t command, uint8_t* data, i
     struct i2c_msg m[2];
 
     m[0].addr = dev->addr;
-    m[0].flags = I2C_M_RD;
+    m[0].flags = 0x00;
     m[0].len = 1;
     m[0].buf = &command;
     m[1].addr = dev->addr;
-    m[1].flags = 0x00;
+    m[1].flags = I2C_M_RD;
     m[1].len = length;
     m[1].buf = data;