Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Garcia <danielgarcia@gmail.com>2013-11-11 07:09:15 +0400
committerDaniel Garcia <danielgarcia@gmail.com>2013-11-11 07:09:15 +0400
commitd6a3acd68715f95465b883d4a8258cfd48bef5a1 (patch)
treecca929ea64da6c6aabb37e31b86fab04b84b6686
parent476560662877d38f1f4b9be1f45d70875ec274b3 (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.cpp18
-rw-r--r--FastLED.h2
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;
}
}
}
diff --git a/FastLED.h b/FastLED.h
index 62e2dcbf..1d7afae1 100644
--- a/FastLED.h
+++ b/FastLED.h
@@ -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);