relax flash mode packet size limits to fix issue 6

pull/12/head
sq5bpf 2023-10-14 19:16:06 +02:00
rodzic 0365f94b01
commit 6eb4ac3822
2 zmienionych plików z 6 dodań i 5 usunięć

2
README
Wyświetl plik

@ -1,4 +1,4 @@
k5prog - Quansheng UV-K5 EEPROM and flash programmer v0.8
k5prog - Quansheng UV-K5 EEPROM and flash programmer v0.9
(c) 2023 Jacek Lipkowski <sq5bpf@lipkowski.org>
This program can read and write the eeprom of Quansheng UV-K5.

Wyświetl plik

@ -1,4 +1,4 @@
/* Quansheng UV-K5 EEPROM programmer v0.8
/* Quansheng UV-K5 EEPROM programmer v0.9
* (c) 2023 Jacek Lipkowski <sq5bpf@lipkowski.org>
*
* This program can read and write the eeprom of Quansheng UVK5 Mark II
@ -50,7 +50,7 @@
#include <stdint.h>
#include "uvk5.h"
#define VERSION "Quansheng UV-K5 EEPROM programmer v0.8 (c) 2023 Jacek Lipkowski <sq5bpf@lipkowski.org>"
#define VERSION "Quansheng UV-K5 EEPROM programmer v0.9 (c) 2023 Jacek Lipkowski <sq5bpf@lipkowski.org>"
#define MODE_NONE 0
#define MODE_READ 1
@ -581,8 +581,9 @@ int wait_flash_message(int fd,int ntimes) {
destroy_k5_struct(cmd);
continue;
}
/* 36 is normal length, 22 is sent by some LSENG UV-K5 clone */
if ((cmd->len!=36)&&(cmd->len!=22)) {
/* 36 is normal length, 22 is sent by some LSENG UV-K5 clone,
* 20 is sent by some other version, so just use an arbitrarily chosen range */
if ((cmd->len<18)||(cmd->len>50)) {
printf("wait_flash_message: got unexpected command length %i\n",cmd->len);
destroy_k5_struct(cmd);
continue;