From 40f71ffcaa790d0961291955957f0ae8f0fd17ef Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 15 Jun 2016 14:19:49 -0700 Subject: [PATCH] Guard against users accidentally overwriting the keymatrix buffer when trying to write an LED that doesn't exist --- implementation/Model01.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/implementation/Model01.cpp b/implementation/Model01.cpp index 6f0767fe..72e071b1 100644 --- a/implementation/Model01.cpp +++ b/implementation/Model01.cpp @@ -37,8 +37,11 @@ void Model01::setup(void) { void Model01::led_set_crgb_at(uint8_t i, cRGB crgb) { if(i<32) { leftHand.ledData.leds[i] = crgb; - } else { + } else if (i<64) { rightHand.ledData.leds[i-32] = crgb; + } else { + // TODO how do we want to handle debugging assertions about crazy user + // code that would overwrite other memory? } }