lf tune: allow float, added parse_getfloat to utils

This commit is contained in:
Philippe Teuwen 2019-10-25 00:53:56 +02:00
commit 390d0ab525
3 changed files with 12 additions and 3 deletions

View file

@ -231,12 +231,12 @@ int CmdLFTune(const char *Cmd) {
}
break;
case 'f': {
int freq = param_get32ex(Cmd, cmdp + 1, 125, 10);
divisor = LF_FREQ2DIV(freq);
if (divisor < 19) {
float freq = param_getfloat(Cmd, cmdp + 1, 125);
if ((freq < 47) || (freq > 600)) {
PrintAndLogEx(ERR, "freq must be between 47 and 600");
return PM3_EINVARG;
}
divisor = LF_FREQ2DIV(freq);
cmdp += 2;
break;
}