Fix data size by using I2C_MESSAGE_MAX_TOTAL_LENGTH instead of I2C_MESSAGE_MAX_PAYLOAD_LENGTH.
This commit is contained in:
@@ -40,7 +40,7 @@ status_t I2cAsyncReadMessage(uint8_t i2cAddress, i2c_message_t *message)
|
||||
masterTransfer.slaveAddress = i2cAddress;
|
||||
masterTransfer.direction = kI2C_Read;
|
||||
masterTransfer.data = (uint8_t*)message;
|
||||
masterTransfer.dataSize = I2C_MESSAGE_MAX_PAYLOAD_LENGTH;
|
||||
masterTransfer.dataSize = I2C_MESSAGE_MAX_TOTAL_LENGTH;
|
||||
I2cMasterHandle.userData = (void*)1;
|
||||
return I2C_MasterTransferNonBlocking(I2C_MAIN_BUS_BASEADDR, &I2cMasterHandle, &masterTransfer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user