From dad51a9353780e9928e35cbfa192817677a90ca9 Mon Sep 17 00:00:00 2001 From: Ben Isaacs <75862+ben-xo@users.noreply.github.com> Date: Thu, 29 Jul 2021 20:59:04 +0100 Subject: Prevent FastLED from hanging on 0-length pixel arrays Without this patch, a 0 length pixel array is treated as if it's 65535 long. Whilst few people will encounter this bug in simple applications, it comes up frequently when manipulating ranges of pixels with multiple PixelControllers. --- src/platforms/avr/clockless_trinket.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platforms/avr/clockless_trinket.h b/src/platforms/avr/clockless_trinket.h index 2cfbef0d..3f333435 100644 --- a/src/platforms/avr/clockless_trinket.h +++ b/src/platforms/avr/clockless_trinket.h @@ -115,7 +115,9 @@ protected: mWait.wait(); cli(); - showRGBInternal(pixels); + if(pixels.mLen > 0) { + showRGBInternal(pixels); + } // Adjust the timer #if (!defined(NO_CORRECTION) || (NO_CORRECTION == 0)) && (FASTLED_ALLOW_INTERRUPTS == 0) -- cgit v1.2.3