chiark / gitweb /
Gah. another small fix to the I2C code.
authorGordon Henderson <projects@drogon.net>
Mon, 20 May 2013 21:23:14 +0000 (22:23 +0100)
committerGordon Henderson <projects@drogon.net>
Mon, 20 May 2013 21:23:14 +0000 (22:23 +0100)
gpio/gpio.c
wiringPi/wiringPiI2C.c

index 504499761b03f70fe1a097fe461c48dfcd681a62..871548ebaa7d0b445ba2f9bc0e1e81855266ddcd 100644 (file)
@@ -48,7 +48,7 @@ extern int wiringPiDebug ;
 #  define      FALSE   (1==2)
 #endif
 
-#define        VERSION         "2.04"
+#define        VERSION         "2.05"
 #define        I2CDETECT       "/usr/sbin/i2cdetect"
 
 static int wpMode ;
index 9e9ccf16230ed2061ba68908479deb3637400cde..c787bcea27d2f24f848c4e841aa3eae22f79e074 100644 (file)
@@ -150,7 +150,7 @@ int wiringPiI2CReadReg16 (int fd, int reg)
   if (i2c_smbus_access (fd, I2C_SMBUS_READ, reg, I2C_SMBUS_WORD_DATA, &data))
     return -1 ;
   else
-    return data.byte & 0xFFFF ;
+    return data.word & 0xFFFF ;
 }