Skip to content

Commit 6eb4ac3

Browse files
committed
relax flash mode packet size limits to fix issue 6
1 parent 0365f94 commit 6eb4ac3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
k5prog - Quansheng UV-K5 EEPROM and flash programmer v0.8
1+
k5prog - Quansheng UV-K5 EEPROM and flash programmer v0.9
22
(c) 2023 Jacek Lipkowski <[email protected]>
33

44
This program can read and write the eeprom of Quansheng UV-K5.

k5prog.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Quansheng UV-K5 EEPROM programmer v0.8
1+
/* Quansheng UV-K5 EEPROM programmer v0.9
22
* (c) 2023 Jacek Lipkowski <[email protected]>
33
*
44
* This program can read and write the eeprom of Quansheng UVK5 Mark II
@@ -50,7 +50,7 @@
5050
#include <stdint.h>
5151
#include "uvk5.h"
5252

53-
#define VERSION "Quansheng UV-K5 EEPROM programmer v0.8 (c) 2023 Jacek Lipkowski <[email protected]>"
53+
#define VERSION "Quansheng UV-K5 EEPROM programmer v0.9 (c) 2023 Jacek Lipkowski <[email protected]>"
5454

5555
#define MODE_NONE 0
5656
#define MODE_READ 1
@@ -581,8 +581,9 @@ int wait_flash_message(int fd,int ntimes) {
581581
destroy_k5_struct(cmd);
582582
continue;
583583
}
584-
/* 36 is normal length, 22 is sent by some LSENG UV-K5 clone */
585-
if ((cmd->len!=36)&&(cmd->len!=22)) {
584+
/* 36 is normal length, 22 is sent by some LSENG UV-K5 clone,
585+
* 20 is sent by some other version, so just use an arbitrarily chosen range */
586+
if ((cmd->len<18)||(cmd->len>50)) {
586587
printf("wait_flash_message: got unexpected command length %i\n",cmd->len);
587588
destroy_k5_struct(cmd);
588589
continue;

0 commit comments

Comments
 (0)