FastLED 3.10.8
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 301 of file transposition.cpp.hpp.

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

References fl::FL_NO_EXCEPT.

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

+ Here is the caller graph for this function: