From c013502d11e25f23b33ba8887a1b84f29441ce84 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Fri, 30 Jul 2021 00:06:29 +0200 Subject: [PATCH] Fix demod plot of data rawdemod --ar and --am --- client/src/cmddata.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/cmddata.c b/client/src/cmddata.c index 4371a0187..2e7b53390 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -424,7 +424,12 @@ int ASKDemod_ext(int clk, int invert, int maxErr, size_t maxlen, bool amplify, b int start_idx = 0; int errCnt = askdemod_ext(bits, &bitlen, &clk, &invert, maxErr, askamp, askType, &start_idx); - + if (start_idx >- clk / 2) { + start_idx -= clk / 2; + } + if ( askType == 0 ) { // if not Manchester, clock width is halved + clk /= 2; + } if (errCnt < 0 || bitlen < 16) { //if fatal error (or -1) PrintAndLogEx(DEBUG, "DEBUG: (ASKDemod_ext) No data found errors:%d, %s bitlen:%zu, clock:%d" , errCnt