From e4b2c47d170f22c193f09a8dd759c759590d7b58 Mon Sep 17 00:00:00 2001 From: sq5bpf Date: Fri, 29 Dec 2023 22:20:34 +0100 Subject: [PATCH] wait for only 0x518 command on flashing --- k5prog.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/k5prog.c b/k5prog.c index 937d312..b6f2cd9 100644 --- a/k5prog.c +++ b/k5prog.c @@ -587,8 +587,8 @@ int wait_flash_message(int fd,int ntimes) { continue; } - if (cmd->cmd[0]!=0x18) { - printf("wait_flash_message: got unexpected command type 0x%2.2x\n",cmd->cmd[0]); + if ((cmd->cmd[0]!=0x18)&&(cmd->cmd[1]!=0x05)) { + printf("wait_flash_message: got unexpected command type 0x%2.2x 0x%2.2x\n",cmd->cmd[1],cmd->cmd[0]); destroy_k5_struct(cmd); continue; } @@ -611,11 +611,6 @@ int wait_flash_message(int fd,int ntimes) { * 0x000020: 00 00 00 20 ... */ - if ((cmd->cmd[2]!=0x20)||(cmd->cmd[3]!=0x0)||(cmd->cmd[4]!=0x1)||(cmd->cmd[5]!=0x2)||(cmd->cmd[6]!=0x2)) { - printf("wait_flash_message: got unexpected packet contents\n"); - destroy_k5_struct(cmd); - continue; - } /* all is good, so break */ ok=1; break;