flash_can: add retries to verification

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan committed 2022-04-25 17:18:35 -04:00
1 parent f754ae2746
commit f0d7bb7f9c
1 file changed
+10 -5
+10 -5
View File
@@ -158,11 +158,16 @@ class CanFlasher:
if resp == i:
# command should ack with the requested block as
# parameter
buf = await self.node.readexactly(
self.block_size, timeout=10.
)
if len(buf) == self.block_size:
break
try:
buf = await self.node.readexactly(
self.block_size, timeout=5.
)
except asyncio.TimeoutError:
if tries:
output_line("\nRead Timeout, Retrying...")
else:
if len(buf) == self.block_size:
break
tries -= 1
await asyncio.sleep(.1)
else: