HAL_Linux: fixed I2C driver build errors
This commit is contained in:
parent
8c4565c741
commit
fa2a1c495e
@ -142,13 +142,13 @@ uint8_t LinuxI2CDriver::readRegisters(uint8_t addr, uint8_t reg,
|
||||
addr : addr,
|
||||
flags : 0,
|
||||
len : 1,
|
||||
buf : ®
|
||||
buf : (char *)®
|
||||
},
|
||||
{
|
||||
addr : addr,
|
||||
flags : I2C_M_RD,
|
||||
len : len,
|
||||
buf : data,
|
||||
buf : (char *)data,
|
||||
}
|
||||
};
|
||||
struct i2c_rdwr_ioctl_data i2c_data = {
|
||||
@ -179,11 +179,11 @@ uint8_t LinuxI2CDriver::readRegistersMultiple(uint8_t addr, uint8_t reg,
|
||||
msgs[i*2].addr = addr;
|
||||
msgs[i*2].flags = 0;
|
||||
msgs[i*2].len = 1;
|
||||
msgs[i*2].buf = ®
|
||||
msgs[i*2].buf = (char *)®
|
||||
msgs[i*2+1].addr = addr;
|
||||
msgs[i*2+1].flags = I2C_M_RD;
|
||||
msgs[i*2+1].len = len;
|
||||
msgs[i*2+1].buf = data;
|
||||
msgs[i*2+1].buf = (char *)data;
|
||||
data += len;
|
||||
};
|
||||
if (ioctl(_fd, I2C_RDWR, &i2c_data) == -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user