-
Notifications
You must be signed in to change notification settings - Fork 0
merge v0.5.0 into master #7
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…crc32_nibble, but only on ESP8266
… to update this several times
…ding EEPROM with BUFFERED_EEPROM on STM32
…st of libraries; new CrcEeprom.cpp is picked up by EpoxyDuino.mk, which then pulls in dependent libraries
…row down interaction with underlying EEPROM to 3 function: write(), read() and commit()
…pter classes; feed IEepromAdapter into CrcEeprom
…s.{h,cpp}; rename BUFFERED_EEPROM to BufferedEEPROM; update demo code
…epromAdapter::begin() for convenience
…the code in this library
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CrcEepromusingEpoxyPromAvrandEpoxyPromEsplibraries from EpoxyDuino.
crc32_nibblemfor the ESP8266only, since it is 2.7X faster than
crc32_nibbleon the ESP8266 platform.contextIdtoCrcEeprom()constructor. This is anapplication-provided identifier that is stored into EEPROM along with the
data and its CRC. When the data is read by
CrcEeprom::readWithCrc(), thecontextIdmust match. This prevents data from a different applicationthat happen to have the same length from being marked as valid.
CrcEeprom::toContextId()helper to generate thecontextId.CrcEeprom::toSavedSize()to calculate the minimum size to pass toCrcEeprom::begin().BufferedEEPROMglobal object for STM32 which implements theESP-flavored API, and uses the "buffered" versions of the low-level EEPROM
functions.
#include <AceUtilsStm32BufferedEeprom.h>.EEPROMis unbuffered, which means everyEEPROM.write()operation causes the entire flash page to be wiped and rewritten.
EspEepromAdapterandAvrEepromAdaptertemplate classes,implementing
IEepromAdapterinterface. These smooth over the APIdifferences between the AVR-flavored EEPROM API and the ESP-flavored
EEPROM API and allow the
CrcEepromclass to support both API flavors.CrcEepromnow accepts aninstance of
IEepromAdapter, instead of using the globalEEPROMobject directly.
BufferedEEPROMobject for the STM32 meant that therecan be 2
EEPROMobjects active concurrently. So theCrcEepromneeds to be told which one to use.
contextIdto theCrcEepromconstructor, defaulting to 0x00.CrcEeprom::writeWithCrc()andreadWithCrc()towriteDataWithCrc()andreadDataWithCrc().writeWithCrc(size_t address, const T& data)readWithCrc(size_t address, T& data).sizeof(T)thencalls the underlying
writeDataWithCrc()andreadDataWithCrc().