| 313 | } |
| 314 | |
| 315 | void 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 | |
| 362 | void CFastLED::clear(bool writeData) { |
| 363 | if(writeData) { |
nothing calls this directly
no test coverage detected