lf: change macros to allow float freq, change 134 -> 134.2
This commit is contained in:
@@ -232,7 +232,7 @@ int CmdLFTune(const char *Cmd) {
|
||||
break;
|
||||
case 'f': {
|
||||
int freq = param_get32ex(Cmd, cmdp + 1, 125, 10);
|
||||
divisor = LF_DIVISOR(freq);
|
||||
divisor = LF_FREQ2DIV(freq);
|
||||
if (divisor < 19) {
|
||||
PrintAndLogEx(ERR, "freq must be between 47 and 600");
|
||||
return PM3_EINVARG;
|
||||
@@ -254,7 +254,7 @@ int CmdLFTune(const char *Cmd) {
|
||||
//Validations
|
||||
if (errors) return usage_lf_tune();
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Measuring LF antenna at %.2f kHz, click button or press Enter to exit", 12000.0 / (divisor + 1));
|
||||
PrintAndLogEx(SUCCESS, "Measuring LF antenna at %.2f kHz, click button or press Enter to exit", LF_DIV2FREQ(divisor));
|
||||
|
||||
uint8_t params[] = {1, 0};
|
||||
params[1] = divisor;
|
||||
@@ -498,7 +498,7 @@ int CmdLFConfig(const char *Cmd) {
|
||||
break;
|
||||
case 'f': {
|
||||
int freq = param_get32ex(Cmd, cmdp + 1, 125, 10);
|
||||
divisor = LF_DIVISOR(freq);
|
||||
divisor = LF_FREQ2DIV(freq);
|
||||
if (divisor < 19) {
|
||||
PrintAndLogEx(ERR, "freq must be between 47 and 600");
|
||||
return PM3_EINVARG;
|
||||
|
||||
Reference in New Issue
Block a user