Fixes I2C read change size of pointer (#479)

Fixes #477
This commit is contained in:
Thad House
2017-02-10 15:21:59 -08:00
committed by Peter Johnson
parent e375b4a9ff
commit 5a5f10dfc8

View File

@@ -122,8 +122,8 @@ bool I2C::Read(int registerAddress, int count, uint8_t* buffer) {
wpi_setWPIErrorWithContext(NullParameter, "buffer");
return true;
}
return Transaction(reinterpret_cast<uint8_t*>(&registerAddress),
sizeof(registerAddress), buffer, count);
uint8_t regAddr = registerAddress;
return Transaction(&regAddr, sizeof(regAddr), buffer, count);
}
/**