diff --git a/common/lfdemod.c b/common/lfdemod.c index ee6d6afe0..89910488d 100644 --- a/common/lfdemod.c +++ b/common/lfdemod.c @@ -1537,6 +1537,11 @@ static uint16_t cleanAskRawDemod(uint8_t *bits, size_t *size, int clk, int inver getNextHigh(bits, *size, high, &pos); // getNextLow(bits, *size, low, &pos); + // do not skip first transition + if ((pos > cl_2 - cl_4 - 1) && (pos <= clk + cl_4 + 1)) { + bits[bitCnt++] = invert ^ 1; + } + // sample counts, like clock = 32.. it tries to find 32/4 = 8, 32/2 = 16 for (size_t i = pos; i < *size; i++) { if (bits[i] >= high && waveHigh) {