feat(rmt): adds new function to send specific number of loops#11748
feat(rmt): adds new function to send specific number of loops#11748
Conversation
Adds a new function `rmtWriteLoopingCount()` to send a specific number of times, repeating the same RMT Symbols.
👋 Hello SuGlider, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Adds: bool rmtWriteLoopingCount(int pin, rmt_data_t *data, size_t num_rmt_symbols, uint32_t loop_count) It will send a pattern defined by `*data` RMT Symbols for `loop_count` times (repeated). This is different from `rmtWriteLooping()`, which will repeat it for ever (endless looping).
Test Results 76 files 76 suites 13m 17s ⏱️ Results for commit ba60ffa. ♻️ This comment has been updated with latest results. |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new RMT function rmtWriteRepeated() that allows transmitting RMT data patterns a specific number of times, providing a middle ground between single transmission and infinite looping.
Key changes:
- Adds
rmtWriteRepeated()function with loop count parameter - Modifies internal
_rmtWrite()function to support finite loop counts - Updates documentation to clarify looping behavior differences
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cores/esp32/esp32-hal-rmt.h | Adds function declaration and updates documentation for the new repeated write functionality |
| cores/esp32/esp32-hal-rmt.c | Implements the core logic for repeated transmission with finite loop counts |
| libraries/ESP32/examples/RMT/RMT_LED_Blink/RMT_LED_Blink.ino | Adds example usage demonstrating the new repeated write function |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description of Change
Adds a new function
rmtWriteRepeated()to send a specific number of times, repeating the same RMT Symbols.Adds:
bool rmtWriteRepeated(int pin, rmt_data_t *data, size_t num_rmt_symbols, uint32_t loop_count)It will send a pattern defined by
*dataRMT Symbols forloop_counttimes (repeated).This is different from
rmtWriteLooping(), which will repeat it for ever (endless looping).Note: ESP32 doesn't support SOC_RMT_SUPPORT_TX_LOOP_COUNT
Test Scenarios
Tested with ESP32 and ESP32-S3.
Based on the example modified in the PR (RMT_LED_Blink.ino)
Related links
Closes #11731