Stop reading when the desired amount of bytes have been read.

This commit is contained in:
László Monda
2017-07-26 02:11:55 +02:00
parent f5d794ec98
commit b48e2b42d3
+3
View File
@@ -53,6 +53,9 @@ static void i2cCallback(I2C_Type *base, i2c_master_handle_t *handle, status_t st
switch (CurrentEepromTransfer) { switch (CurrentEepromTransfer) {
case EepromTransfer_ReadHardwareConfiguration: case EepromTransfer_ReadHardwareConfiguration:
case EepromTransfer_ReadUserConfiguration: case EepromTransfer_ReadUserConfiguration:
if (!IsEepromBusy) {
return;
}
LastEepromTransferStatus = i2cAsyncRead( LastEepromTransferStatus = i2cAsyncRead(
isHardwareConfig ? HardwareConfigBuffer.buffer : UserConfigBuffer.buffer, isHardwareConfig ? HardwareConfigBuffer.buffer : UserConfigBuffer.buffer,
isHardwareConfig ? HARDWARE_CONFIG_SIZE : USER_CONFIG_SIZE isHardwareConfig ? HARDWARE_CONFIG_SIZE : USER_CONFIG_SIZE