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

◆ emitPair()

FASTLED_FORCE_INLINE void fl::channels::rx::Ws2812StreamDecoder::emitPair ( u16 rise,
u16 fall,
bool has_low,
u32 low_ns )
private

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

199 {
200 const u32 high_ns = flexPwmTickDeltaNs(rise, fall, mNsPerTickQ16);
201 // The batch pre-pass samples HIGHs at even edge indices that are not
202 // the last edge (the final pair, emitted by flush(), never is).
203 if ((mEdgeIndex & 1u) == 0 && flexPwmIsMidpointSample(high_ns)) {
204 if (high_ns < mHighMin) mHighMin = high_ns;
205 if (high_ns > mHighMax) mHighMax = high_ns;
206 ++mHighSamples;
207 }
208 emitEdge(true, high_ns);
209 if (has_low) {
210 emitEdge(false, low_ns);
211 pushBit(high_ns, Mode::Midpoint);
212 } else {
213 pushBit(high_ns, Mode::FromHigh);
214 }
215}
void pushBit(u32 high_ns, Mode mode) FL_NO_EXCEPT
void emitEdge(bool high, u32 ns) FL_NO_EXCEPT
bool flexPwmIsMidpointSample(u32 high_ns) FL_NO_EXCEPT
Whether a HIGH width contributes to the adaptive-midpoint pre-pass (idle and glitch widths are exclud...
u32 flexPwmTickDeltaNs(u16 t0, u16 t1, u32 ns_per_tick_q16) FL_NO_EXCEPT
Convert a 16-bit capture-counter delta to ns.

References emitEdge(), FASTLED_FORCE_INLINE, fl::FL_NO_EXCEPT, fl::channels::rx::flexPwmIsMidpointSample(), fl::channels::rx::flexPwmTickDeltaNs(), FromHigh, mEdgeIndex, mHighMax, mHighMin, mHighSamples, Midpoint, mNsPerTickQ16, and pushBit().

Referenced by push().

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