add l/h option to hw tune and optimize order of tuning

This commit is contained in:
Richard Antony Burton 2016-05-30 18:30:38 +01:00
commit fdcfbdcc21
8 changed files with 69 additions and 22 deletions

View file

@ -2048,10 +2048,20 @@ int CmdSamples(const char *Cmd)
int CmdTuneSamples(const char *Cmd)
{
int timeout = 0;
int timeout = 0, arg = FLAG_TUNE_ALL;
if(*Cmd == 'l') {
arg = FLAG_TUNE_LF;
} else if (*Cmd == 'h') {
arg = FLAG_TUNE_HF;
} else if (*Cmd != '\0') {
PrintAndLog("use 'tune' or 'tune l' or 'tune h'");
return 0;
}
printf("\nMeasuring antenna characteristics, please wait...");
UsbCommand c = {CMD_MEASURE_ANTENNA_TUNING};
UsbCommand c = {CMD_MEASURE_ANTENNA_TUNING, {arg, 0, 0}};
SendCommand(&c);
UsbCommand resp;

View file

@ -467,7 +467,7 @@ static command_t CommandTable[] =
{"reset", CmdReset, 0, "Reset the Proxmark3"},
{"setlfdivisor", CmdSetDivisor, 0, "<19 - 255> -- Drive LF antenna at 12Mhz/(divisor+1)"},
{"setmux", CmdSetMux, 0, "<loraw|hiraw|lopkd|hipkd> -- Set the ADC mux to a specific value"},
{"tune", CmdTune, 0, "Measure antenna tuning"},
{"tune", CmdTune, 0, "['l'|'h'] -- Measure antenna tuning (option 'l' or 'h' to limit to LF or HF)"},
{"version", CmdVersion, 0, "Show version information about the connected Proxmark"},
{"status", CmdStatus, 0, "Show runtime status information about the connected Proxmark"},
{"ping", CmdPing, 0, "Test if the pm3 is responsive"},