Re-classify the recorded bits with the decode-time timing and write the partial final byte.
Idempotent; call after flush().
Definition at line 259 of file ws2812_stream_decoder.cpp.hpp.
259 {
262 mStats.gapBitShift =
false;
266 }
267
268 const u32 frame_mid =
270 mStats.frameMidpointNs = frame_mid;
275 int b;
278 if ((b >= 0) != e.stream_valid) {
279 inexact = true;
280 mStats.gapBitShift =
true;
281 continue;
282 }
283 if (b < 0) {
284 continue;
285 }
286 } else {
288 }
289 const u32 byte = e.bit_pos / 8u;
290 if (
byte >=
mOut.size()) {
291 continue;
292 }
293 const u8 mask =
static_cast<u8>(0x80u >> (e.bit_pos % 8u));
296 }
298}
void flush() FL_NO_EXCEPT
End of capture: decode the final pair (HIGH only; its LOW is the reset) and fix the calibration.
static constexpr u32 kExceptionBandNs
Bits within this distance of the calibrated threshold are recorded for re-classification against the ...
Exception mExceptions[kMaxExceptions]
int flexPwmBitFromHigh(u32 high_ns, const ChipsetTiming4Phase &timing) FL_NO_EXCEPT
Bit from a HIGH whose LOW was a gap/reset or was not captured: range check against the T0H / T1H wind...
int flexPwmBitFromMidpoint(u32 high_ns, u32 midpoint_ns) FL_NO_EXCEPT
Bit from a HIGH followed by a normal LOW: HIGH-only midpoint split.
u32 flexPwmAdaptiveMidpointNs(const ChipsetTiming4Phase &timing, u32 high_min, u32 high_max, u32 samples) FL_NO_EXCEPT
#3416 adaptive midpoint: (min + max) / 2 of the observed HIGH widths once there are enough samples sp...
References fl::channels::rx::Ws2812StreamDecoder::Exception::bit_pos, fl::FL_NO_EXCEPT, fl::channels::rx::flexPwmAdaptiveMidpointNs(), fl::channels::rx::flexPwmBitFromHigh(), fl::channels::rx::flexPwmBitFromMidpoint(), fl::flush(), FromHigh, fl::channels::rx::Ws2812StreamDecoder::Exception::high_ns, kExceptionBandNs, mBitCount, mCurByte, mExceptionCount, mExceptions, mHighMax, mHighMin, mHighSamples, mMidpoint, fl::channels::rx::Ws2812StreamDecoder::Exception::mode, mOut, mPartialWritten, mStats, and fl::channels::rx::Ws2812StreamDecoder::Exception::stream_valid.