12IrWidgetAggregating::IrWidgetAggregating(
size_t captureLength,
17:
IrWidget(captureLength, pullup, markExcess, beginningTimeout, endingTimeout) {
27 if (instance !=
nullptr)
43 uint8_t tccr0b = TCCR0B;
48 uint16_t aggThreshold = period * 2U;
61 uint8_t calShiftM1 = 1;
62 uint8_t calCount = 1 << (calShiftM1 + 1);
79 if (millis() >= timeForBeginTimeout) {
84 TCCR0B &= ~(_BV(CS02) | _BV(CS01) | _BV(CS00));
114 *pCapDat = packTimeVal(aggVal);
130 diffVal = ((val - prevVal) & 0xffff) | ((uint32_t) ovlCnt << 16);
134 if (diffVal < aggThreshold) {
142 if (aggCount == calCount) {
143 aggThreshold = aggVal >> calShiftM1;
145 calCount = calCount << 1;
149 *pCapDat = packTimeVal(aggVal);
152 *pCapDat = packTimeVal(diffVal);
167 if (aggThreshold == period * 2U) {
uint32_t frequency_t
Type for modulation frequency in Hz.
uint16_t milliseconds_t
Type for durations in milli seconds.
int16_t markExcess
Microseconds subtracted from pulses and added to gaps.
milliseconds_t beginningTimeout
bool timeouted
True if last receive ended with a timeout.