mirror of
https://github.com/andreili/katapult.git
synced 2025-08-23 19:34:06 +02:00
flash_can: add retries to verification
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
f754ae2746
commit
f0d7bb7f9c
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user