-
Notifications
You must be signed in to change notification settings - Fork 639
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
Initial implementation of RTCMEM storage #1420
Conversation
Store system crash counter and reset reason in rtcmem instead of eeprom Store relay state mask in rtc in addition to the eeprom Store relay state in eeprom only when boot mode requires it Simplify relay state mask calculation / reading using std::bitset
We are not checking for consistency in the flash atm. |
for energy counter the goal here is to protect readings in between save intervals from disappearing? lights are straightforward enough, save 5 channels + brightness + mireds state. even fits inside 64 bit. only unlike relay it always saves - should it have an option like |
Remove crc check and commit requirement Add light state save and restore Add sensor energy total save and restore
Removed crc, added mqtt counter, added general methods for energy total and lights handling. For lights: LIGHT_SAVE_ENABLED should be a setting and somehow wired into this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I would merge it after 1.13.4 so we have time to test it.
Light issue resolved via static check of array size. To reiterate - breaking changes are: I wonder if ntp time can be saved too. |
No obvious things stand up. Merging in the interest of moving milestone forward. Exception system might need some tweaking though:
|
Part of #1265
Store system crash counter and reset reason in rtcmem instead of eeprom
Store relay state mask in rtc in addition to the eeprom
Store relay state in eeprom only when boot mode requires it
Simplify relay state mask calculation / reading via std::bitset
Missing:
energy counter (
EEPROM_ENERGY_COUNT
) - should it be saved like this?mqtt json id counter (
EEPROM_MESSAGE_ID
) - can write here every send, no need for delay like for eeprom.Note:
This also can directly use rtcmem as an array (example from esp-open-rtos)
And idk if consistency check is required at all, and just checking magic value would suffice
+ tracking
resetInfo->reason
forREASON_DEFAULT_RST
/REASON_SOFT_RESTART