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

◆ flexPwmAdaptiveMidpointNs()

u32 fl::channels::rx::flexPwmAdaptiveMidpointNs ( const ChipsetTiming4Phase & timing,
u32 high_min,
u32 high_max,
u32 samples )
inline

#3416 adaptive midpoint: (min + max) / 2 of the observed HIGH widths once there are enough samples spread wide enough to trust; else the static one.

Definition at line 59 of file ws2812_stream_decoder.h.

61 {
62 if (samples >= 16 && high_max > high_min + 200u) {
63 return (high_min + high_max) / 2u;
64 }
65 return flexPwmStaticMidpointNs(timing);
66}
u32 flexPwmStaticMidpointNs(const ChipsetTiming4Phase &timing) FL_NO_EXCEPT
Static threshold between a 0 and a 1 HIGH: midpoint of T0H max / T1H min.

References fl::FL_NO_EXCEPT, and flexPwmStaticMidpointNs().

Referenced by fl::channels::rx::Ws2812StreamDecoder::calibrate(), decodeFlexPwmEdges(), and fl::channels::rx::Ws2812StreamDecoder::finish().

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