ports/esp32/esp32_rmt.c: Fix looping behavior for RMT #11254
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue link: #11213
Problem:
This code below doesn't loop correctly on the ESP32-S3 (tested). It works fine on the ESP32 (also tested).
To fix this I changed the order of
check_esp_err(rmt_write_items(self->channel_id, self->items, num_items, false));
I am not sure about the history behind this module so it may be that this PR has something wrong with it - very open to learning about it. Submitting it for the moment since it fixes the issue for me - tested on ESP32 and ESP32-S3.
Hardware ESP32: ESP32 DEVKIT V1
Hardware ESP32S3: LuatOS ESP32-S3 running MicroPython v1.19.1-995-g0a3600a9a on 2023-03-31; ESP32S3 module (spiram octal) with ESP32S3
Firmware binaries after the change was made
Firmware bin for ESP32: esp32-rmt-loop-fix.zip
Firmware bin for ESP32-S3 OCTAL SPIRAM: firmware-rmt-esp32s3-loop.zip
I almost feel like this section could be simplified but didn't do it since I didn't want to accidentally break something. Let me know if we prefer the simplified version.
Current version where the only difference compared to current code is I changed the order of
rmt_write_items
Simplified version
Happy to run more tests if needed, let me know.