Reduce the number of attempts to 10

+ print number of attempts
This commit is contained in:
MCUdude 2022-01-19 22:55:11 +01:00
parent 325604f970
commit dbac0ecf8c
1 changed files with 5 additions and 6 deletions

View File

@ -675,7 +675,7 @@ int jtagmkII_recv(PROGRAMMER * pgm, unsigned char **msg) {
int jtagmkII_getsync(PROGRAMMER * pgm, int mode) { int jtagmkII_getsync(PROGRAMMER * pgm, int mode) {
int tries; int tries;
#define MAXTRIES 33 #define MAXTRIES 10
unsigned char buf[3], *resp, c = 0xff; unsigned char buf[3], *resp, c = 0xff;
int status; int status;
unsigned int fwver, hwver; unsigned int fwver, hwver;
@ -696,15 +696,14 @@ int jtagmkII_getsync(PROGRAMMER * pgm, int mode) {
/* Get the sign-on information. */ /* Get the sign-on information. */
buf[0] = CMND_GET_SIGN_ON; buf[0] = CMND_GET_SIGN_ON;
avrdude_message(MSG_NOTICE2, "%s: jtagmkII_getsync(): Sending sign-on command: ", avrdude_message(MSG_NOTICE2, "%s: jtagmkII_getsync() attempt %d of %d: Sending sign-on command: ",
progname); progname, tries + 1, MAXTRIES);
jtagmkII_send(pgm, buf, 1); jtagmkII_send(pgm, buf, 1);
status = jtagmkII_recv(pgm, &resp); status = jtagmkII_recv(pgm, &resp);
if (status <= 0) { if (status <= 0) {
avrdude_message(MSG_INFO, "%s: jtagmkII_getsync(): sign-on command: " avrdude_message(MSG_INFO, "%s: jtagmkII_getsync() attempt %d of %d: sign-on command: status %d\n",
"status %d\n", progname, tries + 1, MAXTRIES, status);
progname, status);
} else if (verbose >= 3) { } else if (verbose >= 3) {
putc('\n', stderr); putc('\n', stderr);
jtagmkII_prmsg(pgm, resp, status); jtagmkII_prmsg(pgm, resp, status);