Write all the bytes to the EEPROM that are needed to be written, including the last 2 bytes.

This commit is contained in:
László Monda
2017-07-25 23:57:06 +02:00
parent c5c44efd22
commit 35f78f542d

View File

@@ -40,7 +40,7 @@ static status_t writePage()
buffer[1] = sourceOffset >> 8;
uint8_t writeLength = MIN(sourceLength - sourceOffset, EEPROM_PAGE_SIZE);
memcpy(buffer+EEPROM_ADDRESS_LENGTH, sourceBuffer+sourceOffset, writeLength);
status_t status = i2cAsyncWrite(buffer, writeLength);
status_t status = i2cAsyncWrite(buffer, writeLength+EEPROM_ADDRESS_LENGTH);
sourceOffset += writeLength;
return status;
}