-
Notifications
You must be signed in to change notification settings - Fork 7.6k
FunctionalInterrupt/ScheduledFunctions should be in a library, not in esp32-hal-gpio #2734
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
I don't know if this is redundant, but if integrating the Schedule.h functionality that brings loop-synchronized scheduling, is desired, here's what it takes:
|
ce898df
to
d2ec37c
Compare
here are a few thoughts :)
|
d2ec37c
to
53aa967
Compare
Checked - though they were deleted and resurrected as pure example code, not renamed ;-)
Functional* was previously included from ESP8266. I am working with the WEMOS D1 mini like boards, and I think Arduino is all about portability, please don't restrict this.
Again, Functional* did in fact get accepted earlier from a different source, I am removing them due to problems :-)
Naturally, but helping migrate code is not an evil thing, anyway.
Dropping Schedule in the example is just due to my perception of the original author's intent of adding FunctionalInterrupt in the first place. OK - I hope you can review this PR for it's own merits. The core issue I am addressing is that non-IRAM code will be surreptitiously called from ISRs if FunctionalInterrupt.h gets used. |
f01691b
to
97aba98
Compare
3950637
to
db42f37
Compare
…each completed loop.
(cherry picked from commit d39be67)
Move Schedule to libraries
(cherry picked from commit d39be67)
Same yield behavior as on ESP8266 - scheduler has policies for loop and yield initiated runs.
Move Schedule to libraries
…each completed loop.
(cherry picked from commit d39be67) squash! Add Schedule.(h|cpp) from ESP8266 to run off loopTask. squash! Add Schedule.(h|cpp) from ESP8266 to run off loopTask.
squash! Ticker and Schedule updated from ESP8266 Arduino
…ndling: - VIP treatment in general attach/detach/handling looks untidy: extern symbols without matching header include but copy&paste special under-the-hood c++ delete support, where everyone else has to do their own resource tracking as usual. - FunctionalInterrupt is not used by anything inside core ESP32 Arduino for 8 months now, it can be a library, which reduces precious core size for everyone else. This reverts commit ea61563.
…th functional interrupts.
…as example code. It should be decided whether to reinstate these in the core, or make them an optional library.
…n attachInterruptArg(). This is sufficient for resource management - the function has static duration anyway.
…late the ISR in ICACHE_RAM rule (ESP8266 core catches this).
squash! Return Ticker to libraries only for modularity.
db42f37
to
ef061bc
Compare
After mulling over the situation with the pending PR esp8266/Arduino#6003, I have rewritten the support for std::functional and scheduled interrupts to be less intrusive.
First, the support is revoked. Second, the refactored code is brought back as an example in libraries/ESP32/examples/GPIO/FunctionalInterrupt.
I have unified the code with the ESP8266 version: esp8266/Arduino#6038