-
Notifications
You must be signed in to change notification settings - Fork 105
Add full support for ESP8266/ESP32 #44
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
Conversation
- Switch from avr-libc's avr/eeprom.h to the Arduino EEPROM library for a universal API. - Add a call to EEPROM.commit() for ESP8266 and ESP32, since this is only necessary for those boards. - Add a call to EEPROM.begin() for ESP8266/ESP32 in the WriteRules example sketch.
Now that the readRules and writeRules functions have been updated, there is nothing AVR-specific about this library.
|
It works for me. I even understand the code! (-; |
|
It compiles well, but now I did another test. I tried to save and read the TimeChangeRules. This works on the arduino nano without a problem. The ESP32 seems not to read or write the new rules. The sketch saves the timerules, they are commented out and the sketch is uploaded again. The arduino still shows the correct offset, but the ESP32 does not and falls back to the original offset. |
|
Guys, I hate to just close this but I feel that's the best choice for me at this time. I don't have ESP hardware, so I can't test and I can't much afford the bandwidth anyway. @per1234 I very much appreciate your efforts and the spirit in which they are offered. |
|
I also found that EEPROM does not work outside of the setup or loop function on the ESP32. |
|
O sorry you closed it, it didn't refresh yet. |
|
No worries. I am just not able to address the ESP hardware. Quite frankly the whole EEPROM thing seems like a bit of a hack if they're emulating EEPROM using the flash memory. OK I guess but it seems like a square peg in a round hole. Sorry. |
|
Ok thanks. For other users this might help. |
|
@remcoNL Ah, that constructor won't work on the ESP8266 and ESP32 because it runs before the call to @JChristensen I understand your reasoning. I was mislead into thinking you would be receptive to this PR by your statement:
If this was pursued further, I would suggest reverting the preprocessor conditional on |
readRulesandwriteRulesfunctions compatible with ESP8266/ESP32architecturesfieldI updated the WriteRules example sketch to be compatible with ESP8266/ESP32. This meant adding some preprocessor directives which make it a bit less beginner friendly. I think it was worthwhile to demonstrate to the user that they need to call
EEPROM.begin()in their own sketch if using thereadRulesorwriteRulesfunctions. If you prefer that sketch to remain in its previous AVR-only state, I'm happy to revert that part of this PR.Fixes #43
CC: @remcoNL