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

◆ classify()

FASTLED_FORCE_INLINE void fl::channels::rx::Ws2812StreamDecoder::classify ( u32 high_ns,
Mode mode )
private

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

150 {
151 ++mStats.bits;
152 if (mode == Mode::FromHigh) {
153 const int b = flexPwmBitFromHigh(high_ns, mTiming);
154 record(high_ns, mode, b >= 0);
155 if (b < 0) {
156 ++mStats.errors;
157 return;
158 }
159 appendBit(b);
160 return;
161 }
162 const u32 dist = (high_ns > mMidpoint) ? high_ns - mMidpoint : mMidpoint - high_ns;
163 if (dist <= kExceptionBandNs) {
164 record(high_ns, mode, true);
165 }
167}
void record(u32 high_ns, Mode mode, bool stream_valid) FL_NO_EXCEPT
static constexpr u32 kExceptionBandNs
Bits within this distance of the calibrated threshold are recorded for re-classification against the ...
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.

References appendBit(), FASTLED_FORCE_INLINE, fl::FL_NO_EXCEPT, fl::channels::rx::flexPwmBitFromHigh(), fl::channels::rx::flexPwmBitFromMidpoint(), FromHigh, kExceptionBandNs, mMidpoint, mStats, mTiming, and record().

Referenced by calibrate(), and pushBit().

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