FastLED 3.9.15
Loading...
Searching...
No Matches

◆ getLaneByte()

u8 fl::SPITransposer::getLaneByte ( const LaneData & lane,
size_t byte_idx,
size_t max_size )
staticprivate

Get byte from lane at given index, handling padding automatically.

Examples
/home/runner/work/FastLED/FastLED/src/fl/math/transposition.h.

Definition at line 300 of file transposition.cpp.hpp.

300 {
301 // Calculate padding needed for this lane
302 const size_t lane_size = lane.payload.size();
303 const size_t padding_bytes = max_size - lane_size;
304
305 // If we're in the padding region (prepended to beginning)
306 if (byte_idx < padding_bytes) {
307 // Return padding frame byte (repeating pattern)
308 if (!lane.padding_frame.empty()) {
309 return lane.padding_frame[byte_idx % lane.padding_frame.size()];
310 }
311 return 0x00; // Fallback to zero
312 }
313
314 // We're in the data region
315 const size_t data_idx = byte_idx - padding_bytes;
316 if (data_idx < lane_size) {
317 return lane.payload[data_idx];
318 }
319
320 // Should never reach here if max_size is correct
321 return 0x00;
322}

References fl::span< T, Extent >::empty(), fl::SPITransposer::LaneData::padding_frame, fl::SPITransposer::LaneData::payload, and fl::span< T, Extent >::size().

Referenced by transpose16(), transpose2(), transpose4(), and transpose8().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: