speedup 'hf mf chk'

* fix abort by pressing the PM3 button
This commit is contained in:
pwpiwi 2020-01-09 07:43:11 +01:00
parent ac2668f898
commit d1009af506

View file

@ -858,12 +858,6 @@ int MifareChkBlockKeys(uint8_t *keys, uint8_t keyCount, uint8_t blockNo, uint8_t
uint8_t cascade_levels = 0; uint8_t cascade_levels = 0;
uint64_t ui64Key = 0; uint64_t ui64Key = 0;
// Allow button press to interrupt device
if (BUTTON_PRESS()) {
Dbprintf("ChkKeys: Cancel operation. Exit...");
return -2;
}
int retryCount = 0; int retryCount = 0;
for (uint8_t i = 0; i < keyCount; i++) { for (uint8_t i = 0; i < keyCount; i++) {
@ -894,6 +888,10 @@ int MifareChkBlockKeys(uint8_t *keys, uint8_t keyCount, uint8_t blockNo, uint8_t
return i + 1; return i + 1;
} }
if (BUTTON_PRESS()) {
return -2;
}
return 0; return 0;
} }