Skip to content

Commit

Permalink
Merge pull request FastLED#980 from samguyer/master
Browse files Browse the repository at this point in the history
Added an enforced minimum wait of 50 microseconds between calls to show
  • Loading branch information
kriegsman authored May 25, 2020
2 parents 6a66d92 + c52b4db commit 7c03694
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion platforms/esp/32/clockless_i2s_esp32.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ class ClocklessController : public CPixelLEDController<RGB_ORDER>
// -- Save the pixel controller
PixelController<RGB_ORDER> * mPixels;

public:
// -- Make sure we can't call show() too quickly
CMinWait<50> mWait;

public:

void init()
{
Expand Down Expand Up @@ -574,6 +577,9 @@ class ClocklessController : public CPixelLEDController<RGB_ORDER>
fillBuffer();
fillBuffer();

// -- Make sure it's been at least 50ms since last show
mWait.wait();

i2sStart();

// -- Wait here while the rest of the data is sent. The interrupt handler
Expand All @@ -584,6 +590,8 @@ class ClocklessController : public CPixelLEDController<RGB_ORDER>

i2sStop();

mWait.mark();

// -- Reset the counters
gNumStarted = 0;
}
Expand Down

0 comments on commit 7c03694

Please sign in to comment.