mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
chg: less fallbacks
This commit is contained in:
parent
6113d6bbb4
commit
7785dcbce4
1 changed files with 4 additions and 7 deletions
|
@ -106,17 +106,14 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
uart_reconfigure_timeouts(sp, UART_FPC_CLIENT_RX_TIMEOUT_MS);
|
uart_reconfigure_timeouts(sp, UART_FPC_CLIENT_RX_TIMEOUT_MS);
|
||||||
|
|
||||||
if (!uart_set_speed(sp, speed)) {
|
if (!uart_set_speed(sp, speed)) {
|
||||||
// trying some fallbacks automatically
|
// try fallback automatically
|
||||||
speed = 115200;
|
speed = 115200;
|
||||||
if (!uart_set_speed(sp, speed)) {
|
|
||||||
speed = 9600;
|
|
||||||
if (!uart_set_speed(sp, speed)) {
|
if (!uart_set_speed(sp, speed)) {
|
||||||
uart_close(sp);
|
uart_close(sp);
|
||||||
printf("[!] UART error while setting baudrate\n");
|
printf("[!] UART error while setting baudrate\n");
|
||||||
return INVALID_SERIAL_PORT;
|
return INVALID_SERIAL_PORT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
conn.uart_speed = uart_get_speed(sp);
|
conn.uart_speed = uart_get_speed(sp);
|
||||||
return sp;
|
return sp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue