Eliminates excessive sleep waiting for response and send wait for fast_mode
This commit is contained in:
parent
50f987eb48
commit
ed9e766423
|
@ -83,7 +83,7 @@ static void read_response(uint8_t *dest, size_t *len) {
|
|||
if (timer_expired()) {
|
||||
BAIL_OUT(ERR_TIMEOUT);
|
||||
}
|
||||
usleep(250000);
|
||||
usleep(5000);
|
||||
continue;
|
||||
}
|
||||
BAIL_OUT(ERR_SERIAL_PORT);
|
||||
|
@ -246,7 +246,9 @@ static void wrap_and_send_pkt(uint8_t *data, size_t len, bool fast_mode) {
|
|||
if (pos == out_buf) {
|
||||
write(serial_fd, start_pkt, sizeof(start_pkt));
|
||||
} else {
|
||||
if (!fast_mode) {
|
||||
usleep(20000);
|
||||
}
|
||||
write(serial_fd, start_data, sizeof(start_data));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue