mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-18 03:14:42 +00:00
added verbose level in avrdude_message()
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1321 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
36
butterfly.c
36
butterfly.c
@@ -63,7 +63,7 @@ struct pdata
|
||||
static void butterfly_setup(PROGRAMMER * pgm)
|
||||
{
|
||||
if ((pgm->cookie = malloc(sizeof(struct pdata))) == 0) {
|
||||
avrdude_message("%s: butterfly_setup(): Out of memory allocating private data\n",
|
||||
avrdude_message(MSG_INFO, "%s: butterfly_setup(): Out of memory allocating private data\n",
|
||||
progname);
|
||||
exit(1);
|
||||
}
|
||||
@@ -87,7 +87,7 @@ static int butterfly_recv(PROGRAMMER * pgm, char * buf, size_t len)
|
||||
|
||||
rv = serial_recv(&pgm->fd, (unsigned char *)buf, len);
|
||||
if (rv < 0) {
|
||||
avrdude_message("%s: butterfly_recv(): programmer is not responding\n",
|
||||
avrdude_message(MSG_INFO, "%s: butterfly_recv(): programmer is not responding\n",
|
||||
progname);
|
||||
return -1;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ static int butterfly_vfy_cmd_sent(PROGRAMMER * pgm, char * errmsg)
|
||||
|
||||
butterfly_recv(pgm, &c, 1);
|
||||
if (c != '\r') {
|
||||
avrdude_message("%s: error: programmer did not respond to command: %s\n",
|
||||
avrdude_message(MSG_INFO, "%s: error: programmer did not respond to command: %s\n",
|
||||
progname, errmsg);
|
||||
return -1;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
* Send some ESC to activate butterfly bootloader. This is not needed
|
||||
* for plain avr109 bootloaders but does not harm there either.
|
||||
*/
|
||||
avrdude_message("Connecting to programmer: ");
|
||||
avrdude_message(MSG_INFO, "Connecting to programmer: ");
|
||||
if (pgm->flag & IS_BUTTERFLY_MK)
|
||||
{
|
||||
char mk_reset_cmd[6] = {"#aR@S\r"};
|
||||
@@ -246,7 +246,7 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
butterfly_recv(pgm, &c, 1);
|
||||
if ( c != 'M' && c != '?')
|
||||
{
|
||||
avrdude_message("\nConnection FAILED.");
|
||||
avrdude_message(MSG_INFO, "\nConnection FAILED.");
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
@@ -293,12 +293,12 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
butterfly_send(pgm, "p", 1);
|
||||
butterfly_recv(pgm, &type, 1);
|
||||
|
||||
avrdude_message("Found programmer: Id = \"%s\"; type = %c\n", id, type);
|
||||
avrdude_message(" Software Version = %c.%c; ", sw[0], sw[1]);
|
||||
avrdude_message(MSG_INFO, "Found programmer: Id = \"%s\"; type = %c\n", id, type);
|
||||
avrdude_message(MSG_INFO, " Software Version = %c.%c; ", sw[0], sw[1]);
|
||||
if (hw[0]=='?') {
|
||||
avrdude_message("No Hardware Version given.\n");
|
||||
avrdude_message(MSG_INFO, "No Hardware Version given.\n");
|
||||
} else {
|
||||
avrdude_message("Hardware Version = %c.%c\n", hw[0], hw[1]);
|
||||
avrdude_message(MSG_INFO, "Hardware Version = %c.%c\n", hw[0], hw[1]);
|
||||
};
|
||||
|
||||
/* See if programmer supports autoincrement of address. */
|
||||
@@ -306,14 +306,14 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
butterfly_send(pgm, "a", 1);
|
||||
butterfly_recv(pgm, &PDATA(pgm)->has_auto_incr_addr, 1);
|
||||
if (PDATA(pgm)->has_auto_incr_addr == 'Y')
|
||||
avrdude_message("Programmer supports auto addr increment.\n");
|
||||
avrdude_message(MSG_INFO, "Programmer supports auto addr increment.\n");
|
||||
|
||||
/* Check support for buffered memory access, abort if not available */
|
||||
|
||||
butterfly_send(pgm, "b", 1);
|
||||
butterfly_recv(pgm, &c, 1);
|
||||
if (c != 'Y') {
|
||||
avrdude_message("%s: error: buffered memory access not supported. Maybe it isn't\n"\
|
||||
avrdude_message(MSG_INFO, "%s: error: buffered memory access not supported. Maybe it isn't\n"\
|
||||
"a butterfly/AVR109 but a AVR910 device?\n", progname);
|
||||
return -1;
|
||||
};
|
||||
@@ -321,13 +321,13 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
PDATA(pgm)->buffersize = (unsigned int)(unsigned char)c<<8;
|
||||
butterfly_recv(pgm, &c, 1);
|
||||
PDATA(pgm)->buffersize += (unsigned int)(unsigned char)c;
|
||||
avrdude_message("Programmer supports buffered memory access with buffersize=%i bytes.\n",
|
||||
avrdude_message(MSG_INFO, "Programmer supports buffered memory access with buffersize=%i bytes.\n",
|
||||
PDATA(pgm)->buffersize);
|
||||
|
||||
/* Get list of devices that the programmer supports. */
|
||||
|
||||
butterfly_send(pgm, "t", 1);
|
||||
avrdude_message("\nProgrammer supports the following devices:\n");
|
||||
avrdude_message(MSG_INFO, "\nProgrammer supports the following devices:\n");
|
||||
devtype_1st = 0;
|
||||
while (1) {
|
||||
butterfly_recv(pgm, &c, 1);
|
||||
@@ -336,9 +336,9 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
|
||||
if (c == 0)
|
||||
break;
|
||||
avrdude_message(" Device code: 0x%02x\n", (unsigned int)(unsigned char)c);
|
||||
avrdude_message(MSG_INFO, " Device code: 0x%02x\n", (unsigned int)(unsigned char)c);
|
||||
};
|
||||
avrdude_message("\n");
|
||||
avrdude_message(MSG_INFO, "\n");
|
||||
|
||||
/* Tell the programmer which part we selected.
|
||||
According to the AVR109 code, this is ignored by the bootloader. As
|
||||
@@ -356,7 +356,7 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
return -1;
|
||||
|
||||
if (verbose)
|
||||
avrdude_message("%s: devcode selected: 0x%02x\n",
|
||||
avrdude_message(MSG_INFO, "%s: devcode selected: 0x%02x\n",
|
||||
progname, (unsigned)buf[1]);
|
||||
|
||||
butterfly_enter_prog_mode(pgm);
|
||||
@@ -550,7 +550,7 @@ static int butterfly_page_erase(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, unsig
|
||||
return -1; /* not supported */
|
||||
if (strcmp(m->desc, "eeprom") == 0)
|
||||
return 0; /* nothing to do */
|
||||
avrdude_message("%s: butterfly_page_erase() called on memory type \"%s\"\n",
|
||||
avrdude_message(MSG_INFO, "%s: butterfly_page_erase() called on memory type \"%s\"\n",
|
||||
progname, m->desc);
|
||||
return -1;
|
||||
}
|
||||
@@ -697,7 +697,7 @@ static int butterfly_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m)
|
||||
unsigned char tmp;
|
||||
|
||||
if (m->size < 3) {
|
||||
avrdude_message("%s: memsize too small for sig byte read", progname);
|
||||
avrdude_message(MSG_INFO, "%s: memsize too small for sig byte read", progname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user