Skip to content

Commit 307a87d

Browse files
committed
More help text
1 parent 6932030 commit 307a87d

File tree

7 files changed

+30
-9
lines changed

7 files changed

+30
-9
lines changed

src/avrdude.conf.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3244,7 +3244,7 @@ programmer # pickit_basic
32443244
desc = "MPLAB(R) PICkit Basic in JTAG Mode";
32453245
type = "pickit5";
32463246
prog_modes = PM_JTAG | PM_XMEGAJTAG;
3247-
# extra_features = HAS_VTARG_READ | HAS_BITCLOCK_ADJ; # At the time of testing, HAS_VTARG_READ was not working
3247+
extra_features = HAS_BITCLOCK_ADJ; # HAS_VTARG_READ was not working yet
32483248
connection_type = usb;
32493249
usbvid = 0x04d8;
32503250
usbpid = 0x9055; # PK Basic

src/jtag3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ static int jtag3_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
10711071
else
10721072
my.set_sck = jtag3_set_sck_mega_jtag;
10731073
}
1074-
if(pgm->bitclock != 0.0 && my.set_sck != NULL) {
1074+
if(pgm->bitclock && my.set_sck != NULL) {
10751075
unsigned int clock = 1E-3/pgm->bitclock; // kHz
10761076

10771077
pmsg_notice2("%s(): trying to set JTAG clock to %u kHz\n", __func__, clock);

src/pickit2.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ static void pickit2_teardown(PROGRAMMER *pgm) {
169169
}
170170

171171
static int pickit2_open(PROGRAMMER *pgm, const char *port) {
172+
if(pgm->bitclock && !(pgm->extra_features & HAS_BITCLOCK_ADJ))
173+
pmsg_warning("setting bitclock despite missing HAS_BITCLOCK_ADJ setting in extra_features\n");
172174

173175
#ifdef WIN32
174176
my.usb_handle = open_hid(PICKIT2_VID, PICKIT2_PID);

src/serprog.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ static bool is_serprog_cmd_supported(const unsigned char *cmd_bitmap, unsigned c
165165
// Programmer lifecycle handlers
166166

167167
static int serprog_open(PROGRAMMER *pgm, const char *port) {
168+
if(pgm->bitclock && !(pgm->extra_features & HAS_BITCLOCK_ADJ))
169+
pmsg_warning("setting bitclock despite missing HAS_BITCLOCK_ADJ setting in extra_features\n");
170+
168171
union pinfo pinfo;
169172
pgm->port = port;
170173
pinfo.serialinfo.baud = pgm->baudrate? pgm->baudrate: 115200;
@@ -287,8 +290,8 @@ static int serprog_initialize(const PROGRAMMER *pgm, const AVRPART *part) {
287290

288291
// Set SPI clock frequency
289292
if(!(pgm->extra_features & HAS_BITCLOCK_ADJ))
290-
pmsg_warning("%s does not support adjustable bitclock speed. Ignoring -B flag\n", pgmid);
291-
else if(is_serprog_cmd_supported(my.cmd_bitmap, S_CMD_S_SPI_FREQ)) {
293+
pmsg_warning("setting bitclock despite missing HAS_BITCLOCK_ADJ setting in extra_features\n");
294+
if(is_serprog_cmd_supported(my.cmd_bitmap, S_CMD_S_SPI_FREQ)) {
292295
memset(buf, 0, sizeof buf);
293296
uint32_t frequency = pgm->bitclock > 0? 1/pgm->bitclock: part->factory_fcpu > 0? part->factory_fcpu/4: 250000;
294297

src/stk500v2.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,7 +2213,9 @@ static int stk600_open(PROGRAMMER *pgm, const char *port) {
22132213
if(stk500v2_drain(pgm, 0) < 0 || stk500v2_getsync(pgm) < 0 || stk500v2_drain(pgm, 0) < 0)
22142214
return -1;
22152215

2216-
if(pgm->bitclock != 0.0) {
2216+
if(pgm->bitclock) {
2217+
if(!(pgm->extra_features & HAS_BITCLOCK_ADJ))
2218+
pmsg_warning("setting bitclock despite missing HAS_BITCLOCK_ADJ setting in extra_features\n");
22172219
if(pgm->set_sck_period(pgm, pgm->bitclock) != 0)
22182220
return -1;
22192221
}
@@ -3933,7 +3935,9 @@ static int stk500v2_jtagmkII_open(PROGRAMMER *pgm, const char *port) {
39333935

39343936
my.pgmtype = PGMTYPE_JTAGICE_MKII;
39353937

3936-
if(pgm->bitclock != 0.0) {
3938+
if(pgm->bitclock) {
3939+
if(!(pgm->extra_features & HAS_BITCLOCK_ADJ))
3940+
pmsg_warning("setting bitclock despite missing HAS_BITCLOCK_ADJ setting in extra_features\n");
39373941
if(pgm->set_sck_period(pgm, pgm->bitclock) != 0)
39383942
return -1;
39393943
}
@@ -4028,7 +4032,9 @@ static int stk500v2_dragon_isp_open(PROGRAMMER *pgm, const char *port) {
40284032

40294033
my.pgmtype = PGMTYPE_JTAGICE_MKII;
40304034

4031-
if(pgm->bitclock != 0.0) {
4035+
if(pgm->bitclock) {
4036+
if(!(pgm->extra_features & HAS_BITCLOCK_ADJ))
4037+
pmsg_warning("setting bitclock despite missing HAS_BITCLOCK_ADJ setting in extra_features\n");
40324038
if(pgm->set_sck_period(pgm, pgm->bitclock) != 0)
40334039
return -1;
40344040
}
@@ -4099,7 +4105,9 @@ static int stk500v2_dragon_hv_open(PROGRAMMER *pgm, const char *port) {
40994105
pgm_free(pgmcp);
41004106
my.pgmtype = PGMTYPE_JTAGICE_MKII;
41014107

4102-
if(pgm->bitclock != 0.0) {
4108+
if(pgm->bitclock) {
4109+
if(!(pgm->extra_features & HAS_BITCLOCK_ADJ))
4110+
pmsg_warning("setting bitclock despite missing HAS_BITCLOCK_ADJ setting in extra_features\n");
41034111
if(pgm->set_sck_period(pgm, pgm->bitclock) != 0)
41044112
return -1;
41054113
}
@@ -4136,7 +4144,9 @@ static int stk500v2_jtag3_open(PROGRAMMER *pgm, const char *port) {
41364144

41374145
my.pgmtype = PGMTYPE_JTAGICE3;
41384146

4139-
if(pgm->bitclock != 0.0) {
4147+
if(pgm->bitclock) {
4148+
if(!(pgm->extra_features & HAS_BITCLOCK_ADJ))
4149+
pmsg_warning("setting bitclock despite missing HAS_BITCLOCK_ADJ setting in extra_features\n");
41404150
if(pgm->set_sck_period(pgm, pgm->bitclock) != 0)
41414151
return -1;
41424152
}

src/usbasp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,9 @@ static int usbOpenDevice(const PROGRAMMER *pgm, usb_dev_handle ** device, int ve
622622
static int usbasp_open(PROGRAMMER *pgm, const char *port) {
623623
pmsg_debug("usbasp_open(\"%s\")\n", port);
624624

625+
if(pgm->bitclock && !(pgm->extra_features & HAS_BITCLOCK_ADJ))
626+
pmsg_warning("setting bitclock despite missing HAS_BITCLOCK_ADJ setting in extra_features\n");
627+
625628
// usb_init will be done in usbOpenDevice
626629
LNODEID usbpid = lfirst(pgm->usbpid);
627630
int pid, vid;

src/usbtiny.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ static int usbtiny_open(PROGRAMMER *pgm, const char *name) {
286286
char *dev_name = NULL;
287287
int vid, pid;
288288

289+
if(pgm->bitclock && !(pgm->extra_features & HAS_BITCLOCK_ADJ))
290+
pmsg_warning("setting bitclock despite missing HAS_BITCLOCK_ADJ setting in extra_features\n");
291+
289292
// If no -P was given or '-P usb' was given
290293
if(str_eq(name, "usb"))
291294
name = NULL;

0 commit comments

Comments
 (0)