In stk500v2_command(), detect warning status codes.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@951 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2010-12-14 17:17:33 +00:00
parent 1e3f5b7c49
commit d02285b47e
2 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2010-12-14 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* stk500v2.c (stk500v2_command): Detect warning status codes.
2010-10-22 Nils Springob <nils@nicai-systems.de> 2010-10-22 Nils Springob <nils@nicai-systems.de>
* serial.h: serial_open() calls will now return -1 on error (no call to exit()) * serial.h: serial_open() calls will now return -1 on error (no call to exit())

View File

@ -800,6 +800,32 @@ retry:
/* /*
* Decode STK500v2 errors. * Decode STK500v2 errors.
*/ */
if (buf[1] >= STATUS_CMD_TOUT && buf[1] < 0xa0) {
const char *msg;
char msgbuf[30];
switch (buf[1]) {
case STATUS_CMD_TOUT:
msg = "Command timed out";
break;
case STATUS_RDY_BSY_TOUT:
msg = "Sampling of the RDY/nBSY pin timed out";
break;
case STATUS_SET_PARAM_MISSING:
msg = "The `Set Device Parameters' have not been "
"executed in advance of this command";
default:
sprintf(msgbuf, "unknown, code 0x%02x", buf[1]);
msg = msgbuf;
break;
}
if (quell_progress < 2)
fprintf(stderr, "%s: stk500v2_command(): warning: %s\n",
progname, msg);
buf[1] = STATUS_CMD_OK; /* pretend success */
}
if (buf[1] == STATUS_CMD_OK) if (buf[1] == STATUS_CMD_OK)
return status; return status;
if (buf[1] == STATUS_CMD_FAILED) if (buf[1] == STATUS_CMD_FAILED)