MCPcopy Create free account
hub / github.com/FastLED/FastLED / showColor

Method showColor

src/FastLED.cpp.hpp:315–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315void CFastLED::showColor(const CRGB & color, fl::u8 scale) {
316 while(mNMinMicros && ((fl::micros()-lastshow) < mNMinMicros)) {
317#if SKETCH_HAS_LARGE_MEMORY
318 fl::task::run(250, fl::task::ExecFlags::SYSTEM);
319#endif
320 }
321 lastshow = fl::micros();
322
323 // If we have a function for computing power, use it!
324 if(mPPowerFunc) {
325 scale = (*mPPowerFunc)(scale, mNPowerData);
326 }
327
328 int length = 0;
329 CLEDController *pCur = CLEDController::head();
330 while(pCur && length < MAX_CLED_CONTROLLERS) {
331 if (pCur->getEnabled()) {
332 gControllersData[length] = pCur->beginShowLeds(pCur->size());
333 } else {
334 gControllersData[length] = nullptr;
335 }
336 length++;
337 pCur = pCur->next();
338 }
339
340 pCur = CLEDController::head();
341 while(pCur && length < MAX_CLED_CONTROLLERS) {
342 if(mNFPS < 100) { pCur->setDither(0); }
343 if (pCur->getEnabled()) {
344 pCur->showColorInternal(color, scale);
345 }
346 pCur = pCur->next();
347 }
348
349 pCur = CLEDController::head();
350 length = 0; // Reset length to 0 and iterate again.
351 while(pCur && length < MAX_CLED_CONTROLLERS) {
352 if (pCur->getEnabled()) {
353 pCur->endShowLeds(gControllersData[length]);
354 }
355 length++;
356 pCur = pCur->next();
357 }
358 countFPS();
359 onEndFrame();
360}
361
362void CFastLED::clear(bool writeData) {
363 if(writeData) {

Callers

nothing calls this directly

Calls 9

getEnabledMethod · 0.80
setDitherMethod · 0.80
showColorInternalMethod · 0.80
microsFunction · 0.70
runFunction · 0.50
beginShowLedsMethod · 0.45
sizeMethod · 0.45
nextMethod · 0.45
endShowLedsMethod · 0.45

Tested by

no test coverage detected