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

Method writePixels

src/platforms/esp/32/core/fastspi_esp32_idf.h:250–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248
249 template <u8 FLAGS, class D, EOrder RGB_ORDER>
250 FL_NO_INLINE void writePixels(PixelController<RGB_ORDER> pixels, void* context) {
251 #if FASTLED_ESP32_SPI_BULK_TRANSFER
252 select();
253 int len = pixels.mLen;
254 CRGB data_block[FASTLED_ESP32_SPI_BULK_TRANSFER_SIZE] = {0};
255 size_t data_block_index = 0;
256
257 while (pixels.has(1)) {
258 if (FLAGS & FLAG_START_BIT) {
259 writeBit<0>(1);
260 }
261 if (data_block_index >= FASTLED_ESP32_SPI_BULK_TRANSFER_SIZE) {
262 writePixelsBulk(data_block, data_block_index);
263 data_block_index = 0;
264 }
265 CRGB rgb(
266 D::adjust(pixels.loadAndScale0()),
267 D::adjust(pixels.loadAndScale1()),
268 D::adjust(pixels.loadAndScale2())
269 ) FL_NOEXCEPT;
270 data_block[data_block_index++] = rgb;
271 pixels.advanceData();
272 pixels.stepDithering();
273 }
274 if (data_block_index > 0) {
275 writePixelsBulk(data_block, data_block_index);
276 data_block_index = 0;
277 }
278 D::postBlock(len, context);
279 release();
280 #else
281 select();
282 int len = pixels.mLen;
283 while (pixels.has(1)) {
284 if (FLAGS & FLAG_START_BIT) {
285 writeBit<0>(1);
286 }
287 writeByte(D::adjust(pixels.loadAndScale0()));
288 writeByte(D::adjust(pixels.loadAndScale1()));
289 writeByte(D::adjust(pixels.loadAndScale2()));
290 pixels.advanceData();
291 pixels.stepDithering();
292 }
293 D::postBlock(len, context);
294 release();
295 #endif
296 }
297};
298
299} // namespace fl

Callers 1

writePixelsBulkMethod · 0.45

Calls 6

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

Tested by

no test coverage detected