| 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 |
no test coverage detected