Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shacker140 opened this issue May 6, 2022 · 2 comments
Closed

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

shacker140 opened this issue May 6, 2022 · 2 comments

Comments

@shacker140
Copy link

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
Copy link
Owner

Naguissa commented May 6, 2022

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

@Naguissa Naguissa closed this as completed May 6, 2022
@shacker140
Copy link
Author

Thanks for the very quick update!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants