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:
Denny Page 2011-11-04 22:25:55 +01:00 committed by Jef Driesen
parent 0ea9f5e8ca
commit 22686d6fe9

View File

@ -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);