[PATCH 1/2] xyz-modem: Wait infinitely for initial y-modem packet
    Pali Rohár 
    pali at kernel.org
       
    Fri Sep 10 22:46:52 CEST 2021
    
    
  
Now when command loady can be aborted / cancelled by CTRL+C, change wait
timeout for initial packet to infinite. This would allow user to not be
hurry when locating file which want to send. Commands loadb and loads
already waits infinitely too.
Signed-off-by: Pali Rohár <pali at kernel.org>
---
 common/xyzModem.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/common/xyzModem.c b/common/xyzModem.c
index ece25acb183b..d6be489a174b 100644
--- a/common/xyzModem.c
+++ b/common/xyzModem.c
@@ -449,8 +449,14 @@ xyzModem_stream_open (connection_info_t * info, int *err)
       return 0;
     }
 
-  while (retries-- > 0)
+  while (1)
     {
+      if (--retries <= 0)
+        {
+          retries = xyzModem_MAX_RETRIES;
+          crc_retries = xyzModem_MAX_RETRIES_WITH_CRC;
+          xyz.crc_mode = true;
+        }
       stat = xyzModem_get_hdr ();
       if (stat == 0)
 	{
-- 
2.20.1
    
    
More information about the U-Boot
mailing list