Naguissa / uEEPROMLib

I2C EEPROM library. Split from uRTCLib. This library controls any I2C EEPROM, independent ones or incorporated on DS1307 or DS3231 RTCs.
https://www.foroelectro.net/librerias-arduino-ide-f29/ueepromlib-arduino-libreria-simple-y-eficaz-para-e-t225.html
GNU Lesser General Public License v3.0
17 stars 4 forks source link

Extra 255ms delay at the end of read access #8

Closed shacker140 closed 2 years ago

shacker140 commented 2 years ago

Hello,

In function _eeprom_read_sub() the loop for reading bytes ends with: for (j = 0; j < 255 && !UEEPROMLIB_WIRE.available(); j++) { delay(uEEPROMLIB_WIRE_SHORT_DELAY); // Little delay to assure EEPROM is able to process data; if missing and inside for loop meses some values uEEPROMLIB_YIELD } which seems fair between each byte access, but (if I understand correctly) should not be called for the last byte. Because on last read byte there will never be new available data, so the for loop will loop 255 times before exiting. Then each read access will add an extra 255ms useless delay.

Naguissa commented 2 years ago

Fixed! It skips next byte availability check in last byte.

shacker140 commented 2 years ago

Thanks for the very quick update!!!