From d7f5813f576267c471e7540a0562b37c42b7f05c Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Thu, 4 Nov 2010 21:21:17 +0100 Subject: [PATCH] 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. --- src/oceanic_atom2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/oceanic_atom2.c b/src/oceanic_atom2.c index 793cc94..81be574 100644 --- a/src/oceanic_atom2.c +++ b/src/oceanic_atom2.c @@ -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) {