Skip to content

Commit

Permalink
tools: kwboot: Wait blk_rsp_timeo when flushing
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
pali authored and stroese committed Jan 31, 2022
1 parent ef95143 commit 8bd15fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/kwboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8bd15fd

Please sign in to comment.