diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2016-05-18 20:41:11 +0300 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2016-05-18 20:41:11 +0300 |
commit | 4fda8a054188d854303a293e3cd89c5a796fd109 (patch) | |
tree | 33778160217d1f2c8379ef3786ce362a4d34e5a5 | |
parent | 47d9ef5c87e2112261dda57ea1614b927f33b4a5 (diff) |
Another possible assist for #306 - add more than one frame re-write attempt
-rw-r--r-- | platforms/esp/8266/clockless_esp8266.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/platforms/esp/8266/clockless_esp8266.h b/platforms/esp/8266/clockless_esp8266.h index 4cb4dcaf..7d2fe454 100644 --- a/platforms/esp/8266/clockless_esp8266.h +++ b/platforms/esp/8266/clockless_esp8266.h @@ -9,6 +9,10 @@ __attribute__ ((always_inline)) inline static uint32_t __clock_cycles() { return cyc; } +#ifndef FASTLED_INTERRUPT_RETRY_COUNT +#define FASTLED_INTERRUPT_RETRY_COUNT 2 +#endif + #define FASTLED_HAS_CLOCKLESS 1 template <int DATA_PIN, int T1, int T2, int T3, EOrder RGB_ORDER = RGB, int XTRA0 = 0, bool FLIP = false, int WAIT_TIME = 5> @@ -32,7 +36,8 @@ protected: virtual void showPixels(PixelController<RGB_ORDER> & pixels) { // mWait.wait(); - if(!showRGBInternal(pixels)) { + int cnt = FASTLED_INTERRUPT_RETRY_COUNT; + while(!showRGBInternal(pixels) && cnt--) { os_intr_unlock(); delayMicroseconds(WAIT_TIME * 10); os_intr_lock(); |