-
Notifications
You must be signed in to change notification settings - Fork 72
lambda function not in IRAM #14
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
Would you improve the code and then I can merge. |
@paul303 can you share your implementation? |
I encountered the same-- example still has this flaw. Just do not use the lambda. Use a separate function defined with IRAM_ATTR:
|
All examples are updated to include the same solution. Additionally, button functions changed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In the example "Esp32RotaryEncoderBasics.ino" the lambda function for calling the ISR is not put into IRAM.
rotaryEncoder.setup([]{rotaryEncoder.readEncoder_ISR();});
Having the complete ISR call in IRAM is something I have painfully learned. My solution is to wrap the call in a plain function like
void IRAM_ATTR readEncoderWrapper_ISR(){ rotaryEncoder.readEncoder_ISR(); }
and set the library up with
rotaryEncoder.setup(readEncoderWrapper_ISR);
This discussion helped me to understand.
I hope this helps.
p.s. thanks for your ai-esp32-rotary-encoder library!
The text was updated successfully, but these errors were encountered: