fix "pulseio.PulseIn maxlen is limited to 128 in esp32" #10397
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.
Sets
.flags.with_dma = 1
in RMT config that is used inpulseio.PulseIn
and fixes #9234.Quoting the documentation:
By my understandig, this removes the limit only being able to receive 128 pulses, which arises due to the "internal memory" being limited to a size given by
SOC_RMT_MEM_WORDS_PER_CHANNEL
.In DMA-mode,
self->raw_symbols
has to be located in internal RAM, not PSRAM, hence the remaining changes.I have tested this on a Waveshare ESP32-S3-Zero and in my setup I can now receive pulse sequences of length 250, which was not possible before.
The documentation also says:
But I checked the esp-idf documentation of all esp variants, and they all reference DMA mode, if RMT hardware is available, so I'm not sure what the documentation is referring to here... If there really are some variants that support RMT but not DMA mode, then this PR would need some guards for that.