diff options
author | Thomas Albers Raviola <thomas@thomaslabs.org> | 2023-08-28 22:08:46 +0200 |
---|---|---|
committer | Thomas Albers Raviola <thomas@thomaslabs.org> | 2023-08-28 22:08:46 +0200 |
commit | 9c826f6f1a652edce0c8bb15b0cf94e259296e53 (patch) | |
tree | 6c7063856d6ac165dd4329694a54c79813cc3afb /serial.c | |
parent | 3199529ab3ed39737454f9f0b4e91915955c38b2 (diff) |
Add delay between attempts
Diffstat (limited to 'serial.c')
-rw-r--r-- | serial.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -206,6 +206,9 @@ read_buf(int fd, size_t len, void *_buf) } else { write_ack(fd, NACK); } + + /* Wait 2 ms between attempts */ + usleep(2000); } err = ERR_NACK; @@ -249,6 +252,9 @@ write_buf(int fd, size_t len, const void *_buf) if (err != NACK) goto error; + + /* Wait 2 ms between attempts */ + usleep(2000); } error: |