FastLED 3.10.8
Loading...
Searching...
No Matches

◆ copyTo()

fl::result< u32, DecodeError > fl::channels::rx::Ws2812StreamDecoder::copyTo ( fl::span< u8 > out) const

Copy the decoded frame into out with the batch decoder's result rules (overflow, >10% error rate, partial final byte).

Call after finish().

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

300 {
301 if (mStats.overrun) {
303 }
304 if (mStats.gapBitShift) {
305 // The capture-time timing kept or dropped a gap bit that the decode
306 // timing would not: every later bit is shifted. Pass the decode
307 // timing as RxConfig::stream_timing.
309 }
310 if (mStats.pairs == 0 || out.size() == 0) {
312 }
313 const u32 full = mStats.fullBytes;
314 if (full > out.size() || full > mOut.size()) {
316 }
317 u32 n = full;
318 if (mPartialWritten && n < out.size()) {
319 ++n;
320 }
321 for (u32 k = 0; k < n; ++k) {
322 out[k] = mOut[k];
323 }
324 if (mStats.bits > 0 && (mStats.errors * 10) > mStats.bits) {
326 }
328}
static expected failure(E err, const char *msg=nullptr) FL_NO_EXCEPT
Create error result.
Definition expected.h:115
static expected success(T value) FL_NO_EXCEPT
Create successful result.
Definition expected.h:108
constexpr fl::size size() const FL_NO_EXCEPT
Definition span.h:483
@ CAPTURE_OVERRUN
Streaming capture lost data (ring overwritten before decode)
Definition rx.h:73
@ HIGH_ERROR_RATE
Symbol decode error rate too high (>10%)
Definition rx.h:70
@ BUFFER_OVERFLOW
Output buffer overflow.
Definition rx.h:71
@ INVALID_ARGUMENT
Invalid input arguments.
Definition rx.h:72

References fl::BUFFER_OVERFLOW, fl::CAPTURE_OVERRUN, fl::expected< T, E >::failure(), fl::FL_NO_EXCEPT, fl::HIGH_ERROR_RATE, fl::INVALID_ARGUMENT, mOut, mPartialWritten, mStats, and fl::expected< T, E >::success().

+ Here is the call graph for this function: