Delay the resending of a command after an error.
Especially the version commands seems to be sensitive to errors. Once the initialization phase is over, a delay is usually not necessary, but it should cause a noticable slowdown either because errors are supposed to be rare.
This commit is contained in:
parent
f8e8bd3b54
commit
d7f5813f57
@ -181,6 +181,10 @@ oceanic_atom2_transfer (oceanic_atom2_device_t *device, const unsigned char comm
|
||||
// Abort if the maximum number of retries is reached.
|
||||
if (nretries++ >= MAXRETRIES)
|
||||
return rc;
|
||||
|
||||
// Delay the next attempt.
|
||||
serial_sleep (100);
|
||||
serial_flush (device->port, SERIAL_QUEUE_INPUT);
|
||||
}
|
||||
|
||||
if (asize) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user