drivers/ws281x: esp32 neopixel driver to set the rmt symbol high/low lengths at init instead of every write#21068
Conversation
…ctures at init instead of every write
|
Currently the Could be done by having Do the ESP gurus here see anything wrong with this potential solution? |
|
The code change looks good to me. Do you happen to already have tested that this doesn't cause any regressions? (Not that I would expect any from the changes, but better safe than sorry.) Otherwise I can give the code a spin. |
I'v been running it yes. So far so good.
That would give me more confidence. |
|
as far as i understand, this change would affect someone's application only if they change clock frequency in run time. with this change in, should someone do such thing, they would have to deinit and reinit the neopixel driver. |
Contribution description
Minor change to the
WS281xdriver, specifically theesp32side.The
ws281xdriver for theesp32uses a hardware module called theRMT, which generates the data signal that thews281xs expect. TheRMTmodule is supplied with the information about how to generate this signal; for a1symbol, how long should the signal be held high, how long should it be low, so on. These1and0symbol high/low times are recalculated at everyRMTwrite.This PR does the calculation once at init. Marginal speed up (~10us on my 80 neopixel strip).
If there was a reason for doing it at every write, it was not obvious to me. Please let me know if so.