chg: 'hw tune' - only show plotwindow if LF antenna is connected (ie we get lf values)

This commit is contained in:
iceman1001 2018-02-09 13:39:32 +01:00
parent ff598db839
commit 5b596f8e82

View file

@ -1451,7 +1451,7 @@ int CmdTuneSamples(const char *Cmd) {
// HF evaluation
if ( v_hf > NON_VOLTAGE )
PrintAndLog("[+] HF antenna: %5.2f V - 13.56 MHz %s", (v_hf * ANTENNA_ERROR)/1000.0, judgement);
PrintAndLog("[+] HF antenna: %5.2f V - 13.56 MHz", (v_hf * ANTENNA_ERROR)/1000.0);
memset(judgement, 0, sizeof(judgement));
@ -1468,13 +1468,19 @@ int CmdTuneSamples(const char *Cmd) {
// graph LF measurements
// even here, these values has 3% error.
uint16_t test = 0;
for (int i = 0; i < 256; i++) {
GraphBuffer[i] = resp.d.asBytes[i] - 128;
test += resp.d.asBytes[i];
}
if ( test > 0 ) {
PrintAndLog("\n[+] Displaying LF tuning graph. Divisor 89 is 134khz, 95 is 125khz.\n\n");
GraphTraceLen = 256;
ShowGraphWindow();
RepaintGraphWindow();
} else {
PrintAndLog("\n[-] Not showing LF tuning graph since all values is zero.\n\n");
}
PrintAndLog("\n[+] Displaying LF tuning graph. Divisor 89 is 134khz, 95 is 125khz.\n\n");
GraphTraceLen = 256;
ShowGraphWindow();
RepaintGraphWindow();
return 0;
}