Skip to content

Add an aditional (void *) arg to the RMT callback (much like Ticker() et.al.). #3345

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

Merged
merged 5 commits into from
Oct 14, 2020

Conversation

dirkx
Copy link
Contributor

@dirkx dirkx commented Oct 11, 2019

Add an aditional (void *) arg to the RMT callback - to allow more flexible handling of the callback (e.g. by passing a private struct or a class pointer).

Same pattern as used by the Ticker() and many others. Example updated & new example with a trapoline added.

This lets you handle multiple RMT handlers with ease & without many global variables or tricks (as the current API does not provide access to the channel).

dirkx added 4 commits October 11, 2019 14:09
…xible handling of the callback (e.g. by passing a private struct or a class pointer). Same pattern as used by the Ticker() and many others. Example updated & new example with a trapoline added.
@me-no-dev
Copy link
Member

nice :) will hold it for a bit, just to make sure that 1.0.4 is all good before I change API

@suhlig
Copy link

suhlig commented Aug 12, 2020

If I understand the situation correctly, there is no way to use a classes member function as callback before this PR is merged. The example that is part of the PR illustrates this nicely by using a trampoline that passes this.

Today this is possible with the ESP8266 Ticker lib, but not with the one for ESP32.

Please merge 🙏

@me-no-dev me-no-dev merged commit d79a1f3 into espressif:master Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants