diff options
| author | Pali Rohár <[email protected]> | 2022-01-25 18:13:01 +0100 |
|---|---|---|
| committer | Stefan Roese <[email protected]> | 2022-01-31 10:23:38 +0100 |
| commit | 8bd15fd1146e13bba4b6d0166e5db4ce10ecf59d (patch) | |
| tree | 013852965077405926f30152305a42668d352d9a | |
| parent | ef95143df4caaf8c144f33ad685d1c51f530f06b (diff) | |
tools: kwboot: Wait blk_rsp_timeo when flushing
Use the blk_rsp_timeo variable when sleeping before flushing tty.
Signed-off-by: Pali Rohár <[email protected]>
Signed-off-by: Marek Behún <[email protected]>
Reviewed-by: Stefan Roese <[email protected]>
| -rw-r--r-- | tools/kwboot.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/kwboot.c b/tools/kwboot.c index 82cfd9a8271..1477c0f0788 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; |
