From 8bd15fd1146e13bba4b6d0166e5db4ce10ecf59d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Tue, 25 Jan 2022 18:13:01 +0100 Subject: [PATCH] tools: kwboot: Wait blk_rsp_timeo when flushing MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Use the blk_rsp_timeo variable when sleeping before flushing tty. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Reviewed-by: Stefan Roese --- tools/kwboot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/kwboot.c b/tools/kwboot.c index 82cfd9a827..1477c0f078 100644 --- a/tools/kwboot.c +++ b/tools/kwboot.c @@ -1081,8 +1081,8 @@ kwboot_xmodem(int tty, const void *_img, size_t size, int baudrate) */ hdrsz += (KWBOOT_XM_BLKSZ - hdrsz % KWBOOT_XM_BLKSZ) % KWBOOT_XM_BLKSZ; - kwboot_printv("Waiting 2s and flushing tty\n"); - sleep(2); /* flush isn't effective without it */ + kwboot_printv("Waiting %d ms and flushing tty\n", blk_rsp_timeo); + usleep(blk_rsp_timeo * 1000); tcflush(tty, TCIOFLUSH); pnum = 1; -- 2.39.5