mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-22 14:13:42 -07:00
small refactoring
This commit is contained in:
parent
0ab6c7b9be
commit
1abc4144ee
1 changed files with 10 additions and 8 deletions
|
@ -271,15 +271,17 @@ int main(int argc, char* argv[]) {
|
|||
set_my_executable_path();
|
||||
|
||||
// open uart
|
||||
int openCount = 0;
|
||||
do {
|
||||
if (!waitCOMPort) {
|
||||
sp = uart_open(argv[1]);
|
||||
if (sp != INVALID_SERIAL_PORT && sp != CLAIMED_SERIAL_PORT)
|
||||
break;
|
||||
msleep(1000);
|
||||
printf(".");
|
||||
} while(waitCOMPort && (++openCount < 20));
|
||||
printf("\n");
|
||||
} else {
|
||||
int openCount = 0;
|
||||
do {
|
||||
sp = uart_open(argv[1]);
|
||||
msleep(1000);
|
||||
printf(".");
|
||||
} while(++openCount < 20 && (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT));
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
// check result of uart opening
|
||||
if (sp == INVALID_SERIAL_PORT) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue