* ft245r.c (ft245r_open): allow for picking a default

device if none has been provided by -P



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1482 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2021-11-24 21:09:33 +00:00
parent 391439493d
commit d947e5893f
2 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2021-11-24 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* ft245r.c (ft245r_open): allow for picking a default
device if none has been provided by -P
2021-11-24 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* jtag3.c (jtag3_edbg_recv_frame): Better handling for

View File

@ -559,10 +559,11 @@ static int ft245r_open(PROGRAMMER * pgm, char * port) {
// read device string cut after 8 chars (max. length of serial number)
if ((sscanf(port, "usb:%8s", device) != 1)) {
avrdude_message(MSG_INFO,
"%s: ft245r_open(): invalid device identifier '%8s'\n",
progname, device);
return -1;
avrdude_message(MSG_NOTICE,
"%s: ft245r_open(): no device identifier in portname, using default\n",
progname);
pgm->usbsn[0] = 0;
devnum = 0;
} else {
if (strlen(device) == 8 ){ // serial number
if (verbose >= 2) {
@ -618,7 +619,8 @@ static int ft245r_open(PROGRAMMER * pgm, char * port) {
pgm->usbsn[0]?pgm->usbsn:NULL,
devnum);
if (rv) {
avrdude_message(MSG_INFO, "can't open ftdi device %d. (%s)\n", devnum, ftdi_get_error_string(handle));
avrdude_message(MSG_INFO, "%s: can't open ftdi device: %s\n",
progname, ftdi_get_error_string(handle));
goto cleanup_no_usb;
}