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:
Axel Wachtler
2014-06-13 20:07:40 +00:00
parent 471b504278
commit c6788bd795
45 changed files with 1854 additions and 2128 deletions

View File

@@ -89,7 +89,7 @@
#ifndef HAVE_PTHREAD_H
static int ft245r_nopthread_open (struct programmer_t *pgm, char * name) {
avrdude_message("%s: error: no pthread support. Please compile again with pthread installed."
avrdude_message(MSG_INFO, "%s: error: no pthread support. Please compile again with pthread installed."
#if defined(_WIN32)
" See http://sourceware.org/pthreads-win32/."
#endif
@@ -107,7 +107,7 @@ void ft245r_initpgm(PROGRAMMER * pgm) {
#elif defined(DO_NOT_BUILD_FT245R)
static int ft245r_noftdi_open (struct programmer_t *pgm, char * name) {
avrdude_message("%s: error: no libftdi or libusb support. Install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again.\n",
avrdude_message(MSG_INFO, "%s: error: no libftdi or libusb support. Install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again.\n",
progname);
return -1;
@@ -165,7 +165,7 @@ static void add_to_buf (unsigned char c) {
else nh = head + 1;
if (nh == tail) {
avrdude_message("buffer overflow. Cannot happen!\n");
avrdude_message(MSG_INFO, "buffer overflow. Cannot happen!\n");
}
buffer[head] = c;
head = nh;
@@ -235,7 +235,7 @@ static int ft245r_chip_erase(PROGRAMMER * pgm, AVRPART * p) {
unsigned char res[4];
if (p->op[AVR_OP_CHIP_ERASE] == NULL) {
avrdude_message("chip erase instruction not defined for part \"%s\"\n",
avrdude_message(MSG_INFO, "chip erase instruction not defined for part \"%s\"\n",
p->desc);
return -1;
}
@@ -260,13 +260,13 @@ static int ft245r_set_bitclock(PROGRAMMER * pgm) {
rate = 150000; /* should work for all ftdi chips and the avr default internal clock of 1MHz */
}
if ((verbose>1) || FT245R_DEBUG) {
avrdude_message(" ft245r: spi bitclk %d -> ft baudrate %d\n",
if (FT245R_DEBUG) {
avrdude_message(MSG_NOTICE2, " ft245r: spi bitclk %d -> ft baudrate %d\n",
rate / 2, rate);
}
r = ftdi_set_baudrate(handle, rate);
if (r) {
avrdude_message("Set baudrate (%d) failed with error '%s'.\n",
avrdude_message(MSG_INFO, "Set baudrate (%d) failed with error '%s'.\n",
rate, ftdi_get_error_string (handle));
return -1;
}
@@ -373,7 +373,7 @@ static int ft245r_program_enable(PROGRAMMER * pgm, AVRPART * p) {
int i;
if (p->op[AVR_OP_PGM_ENABLE] == NULL) {
avrdude_message("%s: AVR_OP_PGM_ENABLE command not defined for %s\n",
avrdude_message(MSG_INFO, "%s: AVR_OP_PGM_ENABLE command not defined for %s\n",
progname, p->desc);
fflush(stderr);
return -1;
@@ -386,8 +386,8 @@ static int ft245r_program_enable(PROGRAMMER * pgm, AVRPART * p) {
if (res[p->pollindex-1] == p->pollvalue) return 0;
if ((verbose>=1) || FT245R_DEBUG) {
avrdude_message("%s: Program enable command not successful. Retrying.\n",
if (FT245R_DEBUG) {
avrdude_message(MSG_NOTICE, "%s: Program enable command not successful. Retrying.\n",
progname);
fflush(stderr);
}
@@ -401,7 +401,7 @@ static int ft245r_program_enable(PROGRAMMER * pgm, AVRPART * p) {
}
}
avrdude_message("%s: Device is not responding to program enable. Check connection.\n",
avrdude_message(MSG_INFO, "%s: Device is not responding to program enable. Check connection.\n",
progname);
fflush(stderr);
@@ -541,7 +541,7 @@ static int ft245r_open(PROGRAMMER * pgm, char * port) {
}
}
if (devnum < 0) {
avrdude_message("%s: invalid portname '%s': use 'ft[0-9]+'\n",
avrdude_message(MSG_INFO, "%s: invalid portname '%s': use 'ft[0-9]+'\n",
progname,port);
return -1;
}
@@ -556,7 +556,7 @@ static int ft245r_open(PROGRAMMER * pgm, char * port) {
if (usbpid) {
pid = *(int *)(ldata(usbpid));
if (lnext(usbpid))
avrdude_message("%s: Warning: using PID 0x%04x, ignoring remaining PIDs in list\n",
avrdude_message(MSG_INFO, "%s: Warning: using PID 0x%04x, ignoring remaining PIDs in list\n",
progname, pid);
} else {
pid = USB_DEVICE_FT245;
@@ -568,7 +568,7 @@ static int ft245r_open(PROGRAMMER * pgm, char * port) {
pgm->usbsn[0]?pgm->usbsn:NULL,
devnum);
if (rv) {
avrdude_message("can't open ftdi device %d. (%s)\n", devnum, ftdi_get_error_string(handle));
avrdude_message(MSG_INFO, "can't open ftdi device %d. (%s)\n", devnum, ftdi_get_error_string(handle));
goto cleanup_no_usb;
}
@@ -598,7 +598,7 @@ static int ft245r_open(PROGRAMMER * pgm, char * port) {
rv = ftdi_set_bitmode(handle, ft245r_ddr, BITMODE_SYNCBB); // set Synchronous BitBang
if (rv) {
avrdude_message("%s: Synchronous BitBangMode is not supported (%s)\n",
avrdude_message(MSG_INFO, "%s: Synchronous BitBangMode is not supported (%s)\n",
progname, ftdi_get_error_string(handle));
goto cleanup;
}
@@ -652,7 +652,7 @@ static void ft245r_close(PROGRAMMER * pgm) {
}
static void ft245r_display(PROGRAMMER * pgm, const char * p) {
avrdude_message("%sPin assignment : 0..7 = DBUS0..7\n",p);/* , 8..11 = GPIO0..3\n",p);*/
avrdude_message(MSG_INFO, "%sPin assignment : 0..7 = DBUS0..7\n",p);/* , 8..11 = GPIO0..3\n",p);*/
pgm_display_generic_mask(pgm, p, SHOW_ALL_PINS);
}
@@ -705,7 +705,7 @@ static void put_request(int addr, int bytes, int n) {
} else {
p = malloc(sizeof(struct ft245r_request));
if (!p) {
avrdude_message("can't alloc memory\n");
avrdude_message(MSG_INFO, "can't alloc memory\n");
exit(1);
}
}
@@ -799,7 +799,7 @@ static int ft245r_paged_write_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
put_request(addr_save, buf_pos, 0);
//ft245r_sync(pgm);
#if 0
avrdude_message("send addr 0x%04x bufsize %d [%02x %02x] page_write %d\n",
avrdude_message(MSG_INFO, "send addr 0x%04x bufsize %d [%02x %02x] page_write %d\n",
addr_save,buf_pos,
extract_data_out(pgm, buf , (0*4 + 3) ),
extract_data_out(pgm, buf , (1*4 + 3) ),