Add a delay between sending the init and version command.
Some devices are having problems during the initialization sequence. The extra delay appears to improve the success rate for the affected devices. There is obviously a small performance penalty, but being able to establish a reliable connection with all devices is more important.
This commit is contained in:
parent
0ea9f5e8ca
commit
22686d6fe9
@ -262,6 +262,9 @@ oceanic_atom2_init (oceanic_atom2_device_t *device)
|
||||
if (rc != DEVICE_STATUS_SUCCESS)
|
||||
return rc;
|
||||
|
||||
// Wait before sending the next command.
|
||||
serial_sleep (1000);
|
||||
|
||||
// Discard all additional bytes (if there are any)
|
||||
serial_flush (device->port, SERIAL_QUEUE_INPUT);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user