diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2013-11-11 07:09:15 +0400 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2013-11-11 07:09:15 +0400 |
commit | d6a3acd68715f95465b883d4a8258cfd48bef5a1 (patch) | |
tree | cca929ea64da6c6aabb37e31b86fab04b84b6686 | |
parent | 476560662877d38f1f4b9be1f45d70875ec274b3 (diff) |
Change clear to clear led arrays, with the boolean option to be whether or not to push cleared led data out to the leds (default to false)
-rw-r--r-- | FastLED.cpp | 18 | ||||
-rw-r--r-- | FastLED.h | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/FastLED.cpp b/FastLED.cpp index 85095210..50c5f243 100644 --- a/FastLED.cpp +++ b/FastLED.cpp @@ -65,15 +65,15 @@ void CFastLED::showColor(const struct CRGB & color, uint8_t scale) { } } -void CFastLED::clear(boolean includeLedData) { - showColor(CRGB(0,0,0), 0); - if(includeLedData) { - for(int i = 0; i < m_nControllers; i++) { - if(m_Controllers[i].pLedData != NULL) { - memset8((void*)m_Controllers[i].pLedData, 0, sizeof(struct CRGB) * m_Controllers[i].nLeds); - } else { - return; - } +void CFastLED::clear(boolean writeData) { + if(writeData) { + showColor(CRGB(0,0,0), 0); + } + for(int i = 0; i < m_nControllers; i++) { + if(m_Controllers[i].pLedData != NULL) { + memset8((void*)m_Controllers[i].pLedData, 0, sizeof(struct CRGB) * m_Controllers[i].nLeds); + } else { + return; } } } @@ -131,7 +131,7 @@ public: /// Update all our controllers with the current led colors void show() { show(m_nScale); } - void clear(boolean includeLedData = true); + void clear(boolean writeData = false); void showColor(const struct CRGB & color, uint8_t scale); |