-
Notifications
You must be signed in to change notification settings - Fork 34
Support for EEPROM #166
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
Comments
The primary difference between the EEPROM vs SPI and Wire libraries is that not all boards platforms have a bundled EEPROM library. The reason being that not all microcontrollers have EEPROM. Some boards platforms of microcontrollers without EEPROM provide an EEPROM library that uses flash memory to simulate EEPROM (example).
|
Is this "bundled library" characteristic related to #140 ? |
No. It only means that the library is only available when compiling for one of the boards of the platform the library is bundled with. For example, if you have the Arduino AVR Boards installed, then the EEPROM library is also installed and you can use it when compiling for the Uno. However, if you then try to compile a sketch that uses the EEPROM library for the Zero, compilation will fail:
The reason for this is that the library is AVR-specific. Making it accessible to other platforms would only be harmful, since it won't compile for other architectures. |
How can I tell if |
AVR has an As for a way to determine EEPROM support for any arbitrary board of any architecture, I don't know. Another thing to consider might be that there is a significant difference in the way the ESP8266 and ESP32 libraries work. A sketch that uses the EEPROM library perfectly on AVR won't work at all on the Espressif boards if it doesn't call EEPROM.begin() and EEPROM.commit()/EEPROM.end() in order to write the data to flash. I don't know whether that's outside the scope of the project. |
It might be worth instrumenting the |
Documentation of the additional API of the ESP9266/ESP32 boards platforms that extends the official Arduino EEPROM library API is here: |
* Introduce EEPROM support (Arduino-CI#166) * Update CHANGELOG.md * Only include EEPROM if board supports it. * Add EEPROM_SIZE to mega boards. * Move `EEPROM_SIZE` macro to `misc/default.yml`. * Use E2END to calculate EEPROM_SIZE. * EEPROM is tested by uno and due so we don't need to add mega2560 (one less file changed). * Simplify reference to EEPROM library. * adding tests for EEPROM * test high memory and array read. * add setup to reset memory before each test * Add documentation of EEPROM (fix Arduino-CI#190). Co-authored-by: Ian <[email protected]> Co-authored-by: Elizabeth Ventura <[email protected]>
As @per1234 explained here, SPI and Wire are platform bundled libraries and I see that mocks are included for them in
arduino_ci
. Is EEPROM similar? Should it be part of the base or an add-on like LiquidCrystal?The text was updated successfully, but these errors were encountered: