clock can be negative

This commit is contained in:
iceman1001 2020-05-14 17:05:51 +02:00
parent e444640068
commit 555d970c7d

View file

@ -247,7 +247,10 @@ int GetPskClock(const char *str, bool printAns) {
size_t firstPhaseShiftLoc = 0;
uint8_t curPhase = 0, fc = 0;
clock1 = DetectPSKClock(bits, size, 0, &firstPhaseShiftLoc, &curPhase, &fc);
setClockGrid(clock1, firstPhaseShiftLoc);
if (clock1 >= 0)
setClockGrid(clock1, firstPhaseShiftLoc);
// Only print this message if we're not looping something
if (printAns)
PrintAndLogEx(SUCCESS, "Auto-detected clock rate: %d", clock1);