File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -488,18 +488,18 @@ async def ping_task():
488488 # If that doesn't work, send the bootloader skip bytes and try again.
489489 # Sending a bunch at a time fixes UART issues when the radio was previously
490490 # probed with another library at a different baudrate.
491+ LOGGER .debug ("Sending CC253x bootloader skip bytes" )
491492 self ._uart .write (256 * bytes ([c .ubl .BootloaderRunMode .FORCE_RUN ]))
492493
493494 await asyncio .sleep (AFTER_BOOTLOADER_SKIP_BYTE_DELAY )
494495
495- try :
496- async with async_timeout .timeout (CONNECT_PING_TIMEOUT ):
497- return await self .request (c .SYS .Ping .Req ())
498- except asyncio .TimeoutError :
499- pass
500-
501- # At this point we have nothing else to try, don't catch the timeout
502- return await self .request (c .SYS .Ping .Req ())
496+ # At this point we have nothing left to try
497+ while True :
498+ try :
499+ async with async_timeout .timeout (2 * CONNECT_PING_TIMEOUT ):
500+ return await self .request (c .SYS .Ping .Req ())
501+ except asyncio .TimeoutError :
502+ pass
503503
504504 async with self .capture_responses ([CatchAllResponse ()]) as responses :
505505 ping_task = asyncio .create_task (ping_task ())
You can’t perform that action at this time.
0 commit comments