Permalink
Browse files

taking even more care of what version of linux/i2c-dev.h we have

  • Loading branch information...
giuliomoro committed Aug 24, 2017
1 parent 56f4628 commit 04aa0ff3fa7e647cec6b27ab561f9ba324ba4222
Showing with 5 additions and 2 deletions.
  1. +2 −2 examples/06-Sensors/capacitive-touch/I2C_MPR121.cpp
  2. +3 −0 include/I2c.h
@@ -94,7 +94,7 @@ uint16_t I2C_MPR121::touched(void) {
uint8_t I2C_MPR121::readRegister8(uint8_t reg) {
unsigned char inbuf, outbuf;
i2c_char_t inbuf, outbuf;
struct i2c_rdwr_ioctl_data packets;
struct i2c_msg messages[2];
@@ -127,7 +127,7 @@ uint8_t I2C_MPR121::readRegister8(uint8_t reg) {
}
uint16_t I2C_MPR121::readRegister16(uint8_t reg) {
unsigned char inbuf[2], outbuf;
i2c_char_t inbuf[2], outbuf;
struct i2c_rdwr_ioctl_data packets;
struct i2c_msg messages[2];
View
@@ -24,6 +24,9 @@
// If this is not defined, we have the "stock" i2c-dev.h
// so we include linux/i2c.h
#include <linux/i2c.h>
typedef unsigned char i2c_char_t;
#else
typedef char i2c_char_t;
#endif
#include <sys/ioctl.h>
#include <stropts.h>

0 comments on commit 04aa0ff

Please sign in to comment.