Merge pull request #704 from cintainfinita/tearoff2

Fix uint8 vs uint32 interval number for tearoff experiment
This commit is contained in:
Philippe Teuwen 2020-04-19 00:00:13 +02:00 committed by GitHub
commit 2e8c914c7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2695,7 +2695,7 @@ static int CmdHF14AMfuOtpTearoff(const char *Cmd) {
uint8_t cmdp = 0;
bool errors = 0;
uint8_t teardata[8] = {0x00};
uint8_t interval = 500; // time in us
uint32_t interval = 500; // time in us
uint32_t timeLimit = 3000; // time in us
uint32_t startTime = 0; // time in us
@ -2712,7 +2712,7 @@ static int CmdHF14AMfuOtpTearoff(const char *Cmd) {
cmdp += 2;
break;
case 'i':
interval = param_get8(Cmd, cmdp + 1);
interval = param_get32ex(Cmd, cmdp + 1, interval, 10);
if (interval <= 0) {
PrintAndLogEx(WARNING, "Wrong interval number");
errors = true;
@ -2720,7 +2720,7 @@ static int CmdHF14AMfuOtpTearoff(const char *Cmd) {
cmdp += 2;
break;
case 'l':
timeLimit = param_get32ex(Cmd, cmdp + 1, 2000, 10);
timeLimit = param_get32ex(Cmd, cmdp + 1, timeLimit, 10);
if (timeLimit < interval) {
PrintAndLogEx(WARNING, "Wrong time limit number");
errors = true;