提交 dffeb400 编写于 作者: P Pali Rohár 提交者: Tom Rini

xyz-modem: Allow to cancel transfer also by CTRL+C

Currently it is possible to cancel loadx and loady commands by pressing
CTRL+X (CAN character) at least 3 times quickly.

All other U-Boot commands, including loadb and loads can be cancelled by
CTRL+C. So allow it also in xyz-modem code used by loadx and loady
commands. Implement it by handling CTRL+C (ETX character) in the same way
as CTRL+X (CAN character).

Due to how x/y-modem protocol works, it is required to press
CTRL+C or CTRL+X at least 3 times quickly.
Signed-off-by: NPali Rohár <pali@kernel.org>
Reviewed-by: NSimon Glass <sjg@chromium.org>
上级 c97b2557
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
/* Values magic to the protocol */ /* Values magic to the protocol */
#define SOH 0x01 #define SOH 0x01
#define STX 0x02 #define STX 0x02
#define ETX 0x03 /* ^C for interrupt */
#define EOT 0x04 #define EOT 0x04
#define ACK 0x06 #define ACK 0x06
#define BSP 0x08 #define BSP 0x08
...@@ -283,6 +284,7 @@ xyzModem_get_hdr (void) ...@@ -283,6 +284,7 @@ xyzModem_get_hdr (void)
hdr_found = true; hdr_found = true;
break; break;
case CAN: case CAN:
case ETX:
xyz.total_CAN++; xyz.total_CAN++;
ZM_DEBUG (zm_dump (__LINE__)); ZM_DEBUG (zm_dump (__LINE__));
if (++can_total == xyzModem_CAN_COUNT) if (++can_total == xyzModem_CAN_COUNT)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册