-
Notifications
You must be signed in to change notification settings - Fork 40
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
Hardcode EEPROM size #62
Comments
👍 I missed that, good catch and I've added the correct offset math to the code. |
Are you going to create the EEPROM size variable too?. |
I wanted to fix the actual bug first, before the new release was published. I still need to think about changing the begin() method, which is why this issue is still open. |
What I will do is add another public uint16_t variable "_EEPROM_size" which is only valid for the ESP32 and ESP8266 platform. It defaults to 512 but can be changed before the begin() is called. |
Added new public variable "_EEPROM_size" for ESP32 and ESP8266 which defaults to 512 bytes but allows changing the size prior to the begin() call.
Perfect! Thank you for your support. |
OK, that should work! |
I think there should be a posibility to set EEPROM size in begin() method. Before your last merged I did a test with an EEPROM_offset and works correctly but changing the line
EEPROM.begin(512).
For example, If I need 400 bytes for my main project and I want another 512 bytes for INA library the begin method should set EEPROM to 912. Right?. You can expose antoher variable to set EEPROM size and initializate to a default value to have backwards compatibility.
In the other hand, you calculate max_devices including the EEPROM_offset variable ,If the library is not allowed to use the offset, the maximum devices should be:
maxDevices = (EEPROM_size - _EEPROM_offset ) / sizeof(inaEE);
instead of
maxDevices = (_EEPROM_offset + EEPROM_size) / sizeof(inaEE);
I did all the tests with an ESP32. Hope something of that help you to improve the library,
The text was updated successfully, but these errors were encountered: