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>2014-10-22 07:01:20 +0400
committerDaniel Garcia <danielgarcia@gmail.com>2014-10-22 07:01:20 +0400
commit8416d5a77a0f576a2c10cfe32c032d86bb5a5ea1 (patch)
tree9fa1e649245a6fb5b867af85b339837bcb1738a9
parent82894a15fd780a7b8941bde5aa8f281002734a84 (diff)
Silently disable dithering if the frame rate is < 100fps
-rw-r--r--FastLED.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/FastLED.cpp b/FastLED.cpp
index 814cfbf5..c87e8e31 100644
--- a/FastLED.cpp
+++ b/FastLED.cpp
@@ -37,7 +37,10 @@ CLEDController &CFastLED::addLeds(CLEDController *pLed,
void CFastLED::show(uint8_t scale) {
CLEDController *pCur = CLEDController::head();
while(pCur) {
+ uint8_t d = pCur->getDither();
+ if(m_nFPS < 100) { pCur->setDither(0); }
pCur->showLeds(scale);
+ pCur->setDither(d);
pCur = pCur->next();
}
countFPS();
@@ -68,7 +71,10 @@ CLEDController & CFastLED::operator[](int x) {
void CFastLED::showColor(const struct CRGB & color, uint8_t scale) {
CLEDController *pCur = CLEDController::head();
while(pCur) {
+ uint8_t d = pCur->getDither();
+ if(m_nFPS < 100) { pCur->setDither(0); }
pCur->showColor(color, scale);
+ pCur->setDither(d);
pCur = pCur->next();
}
countFPS();