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

Method writePixels

src/platforms/avr/fastspi_avr.h:492–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490 // write a block of uint8_ts out in groups of three. len is the total number of uint8_ts to write out. The template
491 // parameters indicate how many uint8_ts to skip at the beginning and/or end of each grouping
492 template <u8 FLAGS, class D, EOrder RGB_ORDER> void writePixels(PixelController<RGB_ORDER> pixels, void* context = nullptr) FL_NOEXCEPT {
493 //setSPIRate();
494 int len = pixels.mLen;
495
496 select();
497 while(pixels.has(1)) {
498 if(FLAGS & FLAG_START_BIT) {
499 writeBit<0>(1);
500 writeBytePostWait(D::adjust(pixels.loadAndScale0()));
501 writeBytePostWait(D::adjust(pixels.loadAndScale1()));
502 writeBytePostWait(D::adjust(pixels.loadAndScale2()));
503 } else {
504 writeByte(D::adjust(pixels.loadAndScale0()));
505 writeByte(D::adjust(pixels.loadAndScale1()));
506 writeByte(D::adjust(pixels.loadAndScale2()));
507 }
508
509 pixels.advanceData();
510 pixels.stepDithering();
511 }
512 D::postBlock(len);
513 release();
514 }
515
516 /// Finalize transmission (no-op for AVR Hardware SPI)
517 /// This method exists for compatibility with other SPI implementations

Callers

nothing calls this directly

Calls 8

selectFunction · 0.85
writeBytePostWaitFunction · 0.85
releaseFunction · 0.85
writeByteFunction · 0.50
waitFullyFunction · 0.50
hasMethod · 0.45
advanceDataMethod · 0.45
stepDitheringMethod · 0.45

Tested by

no test coverage detected