Skip to content

Better timing stability for ESP32 - #965

Merged
kriegsman merged 2 commits into
FastLED:masterfrom
samguyer:master
Feb 11, 2020
Merged

kriegsman merged 2 commits into
FastLED:masterfrom
samguyer:master

Conversation

@samguyer

Copy link
Copy Markdown
Contributor

(1) A forced minimum delay of 50 microseconds between calls to show(). The way the driver is written it does not explicitly send a latching signal. I noticed that on the ESP32 it is possible to call show() so quickly that the strip doesn't latch, and the new signal appears to be an extension of the previous one.

(2) An option to lock out SPI flash access (e.g., using SPIFFS) during a call to show(). SPI flash access on the ESP32 requires a lockdown of the memory bus. To enforce this requirement, the ESP-IDF system software disables all tasks on both cores until flash operations complete. If this lockout happens during a call to show(), the timing gets off, and the LEDs look flashy. I added a switch that causes the driver to acquire a lock on the flash system, effectively delaying the flash operations until show() is complete. You can enable it by adding the following line before you include FastLED.h:

#define FASTLED_ESP32_FLASH_LOCK

… calls to show() to be at least 50 microseconds apart. Second, added optional calls to ESP-IDF functions that force flash operations to wait until show() is complete.
@kriegsman
kriegsman merged commit fec0f03 into FastLED:master Feb 11, 2020
@kriegsman

Copy link
Copy Markdown
Member

Awesome- thanks, @samguyer! Glad for the great things you're doing with ESP32 and FastLED!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants