Skip to content

Commit 46893be

Browse files
committed
Sharpen warning messages
pgm->type is an internal string that is unknown to users; in fact, even developers don't necessarily know it well. This commit replaces references to pgm->type to the more specific -c programmer (that the user provided).
1 parent 53375f4 commit 46893be

20 files changed

+21
-22
lines changed

src/arduino.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static int arduino_read_sig_bytes(const PROGRAMMER *pgm, const AVRPART *p, const
113113

114114
static int arduino_open(PROGRAMMER *pgm, const char *port) {
115115
if(pgm->bitclock)
116-
pmsg_warning("programmer type %s does not support adjustable bitclock speed; ignoring -B\n", pgm->type);
116+
pmsg_warning("-c %s does not support adjustable bitclock speed; ignoring -B\n", pgmid);
117117

118118
pgm->port = port;
119119
union pinfo pinfo;

src/avr910.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static int avr910_parseextparms(const PROGRAMMER *pgm, const LISTID extparms) {
322322

323323
static int avr910_open(PROGRAMMER *pgm, const char *port) {
324324
if(pgm->bitclock)
325-
pmsg_warning("programmer type %s does not support adjustable bitclock speed; ignoring -B\n", pgm->type);
325+
pmsg_warning("-c %s does not support adjustable bitclock speed; ignoring -B\n", pgmid);
326326

327327
union pinfo pinfo;
328328
if(pgm->baudrate == 0)

src/buspirate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,9 @@ static int buspirate_verifyconfig(const PROGRAMMER *pgm) {
443443
static int buspirate_open(PROGRAMMER *pgm, const char *port) {
444444
if(pgm->bitclock) {
445445
if(str_caseeq(pgm->type, "BusPirate_BB"))
446-
pmsg_warning("programmer type %s does not support adjustable bitclock speed using -B; use -i instead\n", pgm->type);
446+
pmsg_warning("-c %s does not support adjustable bitclock speed using -B; use -i instead\n", pgmid);
447447
else {
448-
pmsg_warning("programmer type %s does not support adjustable bitclock speed; ignoring -B\n", pgm->type);
448+
pmsg_warning("-c %s does not support adjustable bitclock speed; ignoring -B\n", pgmid);
449449
imsg_warning("use -x help to view alternative SPI clock options\n");
450450
}
451451
}

src/butterfly.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static void butterfly_enable(PROGRAMMER *pgm, const AVRPART *p) {
322322

323323
static int butterfly_open(PROGRAMMER *pgm, const char *port) {
324324
if(pgm->bitclock)
325-
pmsg_warning("programmer type %s does not support adjustable bitclock speed; ignoring -B\n", pgm->type);
325+
pmsg_warning("-c %s does not support adjustable bitclock speed; ignoring -B\n", pgmid);
326326

327327
pgm->port = port;
328328

src/ch341a.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static int ch341a_open(PROGRAMMER *pgm, const char *port) {
252252
}
253253

254254
if(pgm->bitclock)
255-
pmsg_warning("programmer type %s does not support adjustable bitclock speed; ignoring -B\n", pgm->type);
255+
pmsg_warning("-c %s does not support adjustable bitclock speed; ignoring -B\n", pgmid);
256256

257257
return 0;
258258
}

src/dryrun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ static void dryrun_disable(const PROGRAMMER *pgm) {
729729

730730
static int dryrun_open(PROGRAMMER *pgm, const char *port) {
731731
if(pgm->bitclock)
732-
pmsg_warning("programmer type %s does not support adjustable bitclock speed; ignoring -B\n", pgm->type);
732+
pmsg_warning("-c %s does not support adjustable bitclock speed; ignoring -B\n", pgmid);
733733

734734
pmsg_debug("%s(%s)\n", __func__, port? port: "NULL");
735735

src/flip1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void flip1_initpgm(PROGRAMMER *pgm) {
181181

182182
static int flip1_open(PROGRAMMER *pgm, const char *port_spec) {
183183
if(pgm->bitclock)
184-
pmsg_warning("programmer type %s does not support adjustable bitclock speed; ignoring -B\n", pgm->type);
184+
pmsg_warning("-c %s does not support adjustable bitclock speed; ignoring -B\n", pgmid);
185185

186186
FLIP1(pgm)->dfu = dfu_open(port_spec);
187187
return (FLIP1(pgm)->dfu != NULL)? 0: -1;

src/flip2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void flip2_initpgm(PROGRAMMER *pgm) {
179179

180180
static int flip2_open(PROGRAMMER *pgm, const char *port_spec) {
181181
if(pgm->bitclock)
182-
pmsg_warning("programmer type %s does not support adjustable bitclock speed; ignoring -B\n", pgm->type);
182+
pmsg_warning("-c %s does not support adjustable bitclock speed; ignoring -B\n", pgmid);
183183

184184
FLIP2(pgm)->dfu = dfu_open(port_spec);
185185
return (FLIP2(pgm)->dfu != NULL)? 0: -1;

src/jtagmkII.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ static int jtagmkII_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
12051205
if(jtagmkII_set_sck_period(pgm, pgm->bitclock) != 0)
12061206
return -1;
12071207
} else {
1208-
pmsg_warning("programmer type %s does not support adjustable bitclock speed; ignoring -B\n", pgm->type);
1208+
pmsg_warning("-c %s is not known to support adjustable bitclock speed; ignoring -B\n", pgmid);
12091209
}
12101210
}
12111211

src/linuxgpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ static void linuxgpio_libgpiod_display(const PROGRAMMER *pgm, const char *p) {
562562

563563
static int linuxgpio_libgpiod_open(PROGRAMMER *pgm, const char *port) {
564564
if(pgm->bitclock)
565-
pmsg_warning("programmer type %s does not support adjustable bitclock speed; ignoring -B\n", pgm->type);
565+
pmsg_warning("-c %s does not support adjustable bitclock speed; ignoring -B\n", pgmid);
566566

567567
if(bitbang_check_prerequisites(pgm) < 0)
568568
return -1;

0 commit comments

Comments
 (0)