From d947e5893f5184c6684e8f648bb21d56e2f38405 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Wed, 24 Nov 2021 21:09:33 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ ft245r.c | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 69ea016a..0b621aad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-11-24 Joerg Wunsch + + * ft245r.c (ft245r_open): allow for picking a default + device if none has been provided by -P + 2021-11-24 Joerg Wunsch * jtag3.c (jtag3_edbg_recv_frame): Better handling for diff --git a/ft245r.c b/ft245r.c index 87b9e0bc..7bda4f3d 100644 --- a/ft245r.c +++ b/ft245r.c @@ -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; }