diff --git a/radio.c b/radio.c index 5730130..d613c90 100644 --- a/radio.c +++ b/radio.c @@ -49,6 +49,7 @@ static struct { { "ZN><:", &radio_rt27d }, // Radtel RT-27D { "BF-5R", &radio_rd5r }, // Baofeng RD-5R { "MD-760P", &radio_gd77 }, // Radioddity GD-77 + { "MD-760", &radio_gd77_old }, // Radioddity GD-77, older versions up to 2.6.6 { 0, 0 } }; @@ -202,6 +203,8 @@ void radio_read_image(const char *filename) device = &radio_rd5r; } else if (memcmp(ident, "MD-760P", 7) == 0) { device = &radio_gd77; + } else if (memcmp(ident, "MD-760", 6) == 0) { + device = &radio_gd77_old; } else { fprintf(stderr, "%s: Unrecognized header '%.6s'\n", filename, ident); diff --git a/radio.h b/radio.h index 95eb5f4..43d9b84 100644 --- a/radio.h +++ b/radio.h @@ -124,6 +124,7 @@ extern radio_device_t radio_dp880; // Zastone DP880 extern radio_device_t radio_rt27d; // Radtel RT-27D extern radio_device_t radio_rd5r; // Baofeng RD-5R extern radio_device_t radio_gd77; // Radioddity GD-77 +extern radio_device_t radio_gd77_old; // Radioddity GD-77, older versions up to 2.6.6 // // Radio: memory contents. diff --git a/rd5r.c b/rd5r.c index a0d4895..53ed155 100644 --- a/rd5r.c +++ b/rd5r.c @@ -406,12 +406,14 @@ static int rd5r_is_compatible(radio_device_t *radio) return strncmp("BF-5R", (char*)&radio_mem[0], 5) == 0; } -// -// Check whether the memory image is compatible with this device. -// static int gd77_is_compatible(radio_device_t *radio) { - return strncmp("MD-760P", (char*)&radio_mem[0], 7) == 0; + return strncmp("MD-760", (char*)&radio_mem[0], 7) == 0; +} + +static int gd77old_is_compatible(radio_device_t *radio) +{ + return strncmp("MD-760", (char*)&radio_mem[0], 6) == 0; } // @@ -2278,3 +2280,22 @@ radio_device_t radio_gd77 = { rd5r_parse_row, rd5r_update_timestamp, }; + +// +// Radioddity GD-77, older versions up to 2.6.6 +// +radio_device_t radio_gd77_old = { + "Radioddity GD-77 (old)", + gd77_download, + rd5r_upload, + gd77old_is_compatible, + rd5r_read_image, + rd5r_save_image, + rd5r_print_version, + rd5r_print_config, + rd5r_verify_config, + rd5r_parse_parameter, + rd5r_parse_header, + rd5r_parse_row, + rd5r_update_timestamp, +}; diff --git a/util.c b/util.c index 7e45830..3566c4d 100644 --- a/util.c +++ b/util.c @@ -256,7 +256,7 @@ void print_ascii(FILE *out, const unsigned char *text, unsigned nchars, int fill ch = *text++; if (ch == '\t') ch = ' '; - if (nchars <= 16 && ch == ' ') + if (fill_flag && ch == ' ') ch = '_'; putc(ch, out); }