From 463661869ad49ee8a797d5aff153b980bc2b6038 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 4 Apr 2019 23:32:47 +0200 Subject: [PATCH] clean uo --- common/lfdemod.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/common/lfdemod.c b/common/lfdemod.c index 93ae2266f..bd51a29b4 100644 --- a/common/lfdemod.c +++ b/common/lfdemod.c @@ -1614,16 +1614,14 @@ int askdemod(uint8_t *bits, size_t *size, int *clk, int *invert, int maxErr, uin // by marshmellow - demodulate NRZ wave - requires a read with strong signal // peaks invert bit (high=1 low=0) each clock cycle = 1 bit determined by last peak int nrzRawDemod(uint8_t *dest, size_t *size, int *clk, int *invert, int *startIdx) { + if (signalprop.isnoise) return -1; size_t clkStartIdx = 0; *clk = DetectNRZClock(dest, *size, *clk, &clkStartIdx); if (*clk == 0) return -2; - size_t i, gLen = 4096; - if (gLen > *size) - gLen = *size - 20; - + size_t i; // just noise - no super good detection. good enough if (signalprop.isnoise) { @@ -1632,7 +1630,7 @@ int nrzRawDemod(uint8_t *dest, size_t *size, int *clk, int *invert, int *startId } int high, low; - //getHiLo(dest, gLen, &high, &low, 75, 75); + getHiLo(&high, &low, 75, 75); getHiLo(&high, &low, 75, 75);