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

Method writePixels

src/platforms/avr/fastspi_avr.h:313–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311 // write a block of uint8_ts out in groups of three. len is the total number of uint8_ts to write out. The template
312 // parameters indicate how many uint8_ts to skip at the beginning and/or end of each grouping
313 template <u8 FLAGS, class D, EOrder RGB_ORDER> void writePixels(PixelController<RGB_ORDER> pixels, void* context = nullptr) FL_NOEXCEPT {
314 //setSPIRate();
315 int len = pixels.mLen;
316
317 select();
318 while(pixels.has(1)) {
319 if(FLAGS & FLAG_START_BIT) {
320 writeBit<0>(1);
321 writeBytePostWait(D::adjust(pixels.loadAndScale0()));
322 writeBytePostWait(D::adjust(pixels.loadAndScale1()));
323 writeBytePostWait(D::adjust(pixels.loadAndScale2()));
324 } else {
325 writeByte(D::adjust(pixels.loadAndScale0()));
326 writeByte(D::adjust(pixels.loadAndScale1()));
327 writeByte(D::adjust(pixels.loadAndScale2()));
328 }
329
330 pixels.advanceData();
331 pixels.stepDithering();
332 }
333 D::postBlock(len);
334 waitFully();
335 release();
336 }
337
338 /// Finalize transmission (no-op for AVR USART0 SPI)
339 /// 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