Skip to content

lambda function not in IRAM #14

Closed
Closed
@paul303

Description

@paul303

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions