diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c6cba7e2..2f10e9c97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] + - Fix `data rawdemod` parsing for psk2 and user defined clock (@cyberpunk-re) - Fix issue #844 - `lf t55xx config` => recompute block0 (@cyberpunk-re) - EM4x50: changed cli parameter from w (word) to d (data) (@tharexde) - EM4x50: new function 4x50 login: authenticate against tag (@tharexde) diff --git a/client/src/cmddata.c b/client/src/cmddata.c index daff73722..7c6fd4785 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -1428,7 +1428,7 @@ static int CmdRawDemod(const char *Cmd) { else if (str_startswith(Cmd, "am")) ans = Cmdaskmandemod(Cmd + 2); else if (str_startswith(Cmd, "ar")) ans = Cmdaskrawdemod(Cmd + 2); else if (str_startswith(Cmd, "nr") || Cmd[0] == 'n') ans = CmdNRZrawDemod(Cmd + 2); - else if (str_startswith(Cmd, "p1") || Cmd[0] == 'p') ans = CmdPSK1rawDemod(Cmd + 2); + else if (str_startswith(Cmd, "p1")) ans = CmdPSK1rawDemod(Cmd + 2); else if (str_startswith(Cmd, "p2")) ans = CmdPSK2rawDemod(Cmd + 2); else PrintAndLogEx(WARNING, "Unknown modulation entered - see help ('h') for parameter structure"); diff --git a/common/lfdemod.c b/common/lfdemod.c index b6869ba43..24de41676 100644 --- a/common/lfdemod.c +++ b/common/lfdemod.c @@ -1081,6 +1081,11 @@ int DetectPSKClock(uint8_t *dest, size_t size, int clock, size_t *firstPhaseShif *firstPhaseShift = firstFullWave; if (g_debugMode == 2) prnt("DEBUG PSK: firstFullWave: %zu, waveLen: %d", firstFullWave, fullWaveLen); + // Avoid autodetect if user selected a clock + for(uint8_t validClk = 1; validClk < 8; validClk++) { + if(clock == clk[validClk]) return(clock); + } + //test each valid clock from greatest to smallest to see which lines up for (clkCnt = 7; clkCnt >= 1 ; clkCnt--) { uint8_t tol = *fc / 2;