From 3b175f9bbfd40236423acf1cf9c0db9b50195784 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 20 Nov 2016 08:48:13 +0100 Subject: [PATCH] Fix a warning in led_get_crgb_at Instead of not handling the case where the LED index is out of range, and thus producing a warning, return a black color instead. It's as good as anything else, but at least gets rid of the warning. And, it goes hand-in-hand with the set counterpart, which, in a similar case, does nothing: thus the out-of-range LED remains black forever. Signed-off-by: Gergely Nagy --- src/Model01.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Model01.cpp b/src/Model01.cpp index 7290b70f..c875c372 100644 --- a/src/Model01.cpp +++ b/src/Model01.cpp @@ -50,6 +50,8 @@ cRGB Model01::led_get_crgb_at(uint8_t i) { return leftHand.ledData.leds[i]; } else if (i<64) { return rightHand.ledData.leds[i-32] ; + } else { + return {0, 0, 0}; } }