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

◆ flush()

void fl::channels::rx::Ws2812StreamDecoder::flush ( )

End of capture: decode the final pair (HIGH only; its LOW is the reset) and fix the calibration.

Call once, after the last push().

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

241 {
242 if (mFlushed) {
243 return;
244 }
245 mFlushed = true;
246 if (mHavePrev) {
247 // The final pair's HIGH is the last edge: not a pre-pass sample, and
248 // classified by the midpoint like the batch decoder's last edge.
250 emitEdge(true, high_ns);
251 pushBit(high_ns, Mode::Midpoint);
252 mHavePrev = false;
253 }
254 if (!mCalibrated) {
255 calibrate();
256 }
257}
void pushBit(u32 high_ns, Mode mode) FL_NO_EXCEPT
void emitEdge(bool high, u32 ns) FL_NO_EXCEPT
u32 flexPwmTickDeltaNs(u16 t0, u16 t1, u32 ns_per_tick_q16) FL_NO_EXCEPT
Convert a 16-bit capture-counter delta to ns.

References calibrate(), emitEdge(), fl::FL_NO_EXCEPT, fl::channels::rx::flexPwmTickDeltaNs(), mCalibrated, mFlushed, mHavePrev, Midpoint, mNsPerTickQ16, mPrevFall, mPrevRise, and pushBit().

+ Here is the call graph for this function: