-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
[TW#16121] No easy way to know when RMT transmission has ended #1175
Comments
@chanibal Hi, chanibal, we have API |
But In my current implementation, I need only to check if RMT has finished transmitting and don't have to execute custom logic at end of transmission. But I can't do that either, because I need to know that from ISR context, and |
For details on what I need this message for, look at the diagram at #1179 (note that I'm not using the so-called RMT and GPIO modes now, both of these are working simmultniously - but the algorithm is wait for falling edge, if rmt is not executing then exec rmt, start over) |
Yes, you are right. |
esp_err_t rmt_wait_tx_done(rmt_channel_t channel, TickType_t wait_time) could be used for polling (with wait_time==0), but it emits an error message. E (54406) rmt: Timeout on wait_tx_done How should I poll for tx busy without causing the error message? |
@phatpaul : Don't. My question is almost a year old, this has been fixed since. |
I see the new callback, and that will be very useful for when I need to wait for tx to be free. But when I enter my CGI function, I would like to know immediately whether tx is busy.
So again, I just want to call rmt_wait_tx_done(rmt_channel_t channel, TickType_t wait_time) (with wait_time==0) to check if tx is busy, without generating an error message. Do you think I should open a new issue for this? Thanks. |
Hi, @phatpaul |
ℹ️ Well, there always was the rmt_get_status The only problem: it is nowhere documented, so barely anyone knows about it, or how to actually make use of it >_<
The bottom line: This whole issue & all of its follow-ups could have most probably been avoided, if there was proper documentation.
there already is one (and has been for a very long time) ... 😑 💩 |
Hi, here is the description of each field of the status register:
we will update the TRM and the IDF soon. thanks!! |
Thanks for the description of the mystery status register. But please also take a look at my pull-request. It adds some needed functions for me and probably for others too. |
Hi @koobest ,
Is this true? Or is read/write swapped in the comments? |
Hi, @johannesmaibaum, The comment is right. One thing to note is that the value of |
The Arduino IDE currently requires the use of a tab separator between the name and identifier. Without this tab the keyword is not highlighted. Reference: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#keywords
From what I know, the only way to know when TX has ended at the moment is to completely replace RMT initialization (
rmt_driver_install
) with copy-pasted and slightly modified version. So it would load the, again slightly modified,rmt_driver_isr_default
where finally you can tap into the event.You could also poll the RMT struct, but that will take time and resources.
I propose an easy fix for this solution adding a handler that will fire when transmission ends, see pull request #1174
The text was updated successfully, but these errors were encountered: