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

Method show

src/FastLED.cpp.hpp:234–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232static void* gControllersData[MAX_CLED_CONTROLLERS];
233
234FL_KEEP_ALIVE void CFastLED::show(fl::u8 scale) {
235 FL_SCOPED_TRACE;
236 onBeginFrame();
237 while(mNMinMicros && ((fl::micros()-lastshow) < mNMinMicros)) {
238#if SKETCH_HAS_LARGE_MEMORY
239 fl::task::run(250, fl::task::ExecFlags::SYSTEM);
240#endif
241 }
242 lastshow = fl::micros();
243
244 // If we have a function for computing power, use it!
245 if(mPPowerFunc) {
246 scale = (*mPPowerFunc)(scale, mNPowerData);
247 }
248
249
250 int length = 0;
251 CLEDController *pCur = CLEDController::head();
252
253 while(pCur && length < MAX_CLED_CONTROLLERS) {
254 if (pCur->getEnabled()) {
255 gControllersData[length] = pCur->beginShowLeds(pCur->size());
256 } else {
257 gControllersData[length] = nullptr;
258 }
259 length++;
260 if (mNFPS < 100) { pCur->setDither(0); }
261 pCur = pCur->next();
262 }
263
264 pCur = CLEDController::head();
265 for (length = 0; length < MAX_CLED_CONTROLLERS && pCur; length++) {
266 if (pCur->getEnabled()) {
267 pCur->showLedsInternal(scale);
268 }
269 pCur = pCur->next();
270
271 }
272
273 length = 0; // Reset length to 0 and iterate again.
274 pCur = CLEDController::head();
275 while(pCur && length < MAX_CLED_CONTROLLERS) {
276 if (pCur->getEnabled()) {
277 pCur->endShowLeds(gControllersData[length]);
278 }
279 length++;
280 pCur = pCur->next();
281 }
282 countFPS();
283 onEndFrame();
284 onEndShowLeds();
285}
286
287void CFastLED::onEndFrame() {
288 #if FASTLED_HAS_ENGINE_EVENTS

Callers 15

setupFunction · 0.45
loopFunction · 0.45
loopFunction · 0.45
loopFunction · 0.45
setupFunction · 0.45
loopFunction · 0.45
setupFunction · 0.45
loopFunction · 0.45
setupFunction · 0.45
test_json_responseFunction · 0.45
test_json_awaitFunction · 0.45

Calls 9

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

Tested by 8

test_json_responseFunction · 0.36
test_json_awaitFunction · 0.36
runTestPatternsMethod · 0.36
loopFunction · 0.36
loopFunction · 0.36
captureFunction · 0.36