Fix data size by using I2C_MESSAGE_MAX_TOTAL_LENGTH instead of I2C_MESSAGE_MAX_PAYLOAD_LENGTH.

This commit is contained in:
László Monda
2017-10-01 22:12:00 +02:00
parent ecc2d2db9a
commit 858586ef2a

View File

@@ -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);
}