+// SPDX-License-Identifier: GPL-2.0-or-later
+
/**************************************************************************
* Copyright (C) 2012 by Andreas Fritiofson *
* andreas.fritiofson@gmail.com *
-* *
-* This program is free software; you can redistribute it and/or modify *
-* it under the terms of the GNU General Public License as published by *
-* the Free Software Foundation; either version 2 of the License, or *
-* (at your option) any later version. *
-* *
-* This program is distributed in the hope that it will be useful, *
-* but WITHOUT ANY WARRANTY; without even the implied warranty of *
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
-* GNU General Public License for more details. *
-* *
-* You should have received a copy of the GNU General Public License *
-* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
/**
#define SWD_MODE (LSB_FIRST | POS_EDGE_IN | NEG_EDGE_OUT)
static char *ftdi_device_desc;
-static char *ftdi_serial;
static uint8_t ftdi_channel;
static uint8_t ftdi_jtag_mode = JTAG_MODE;
for (int i = 0; ftdi_vid[i] || ftdi_pid[i]; i++) {
mpsse_ctx = mpsse_open(&ftdi_vid[i], &ftdi_pid[i], ftdi_device_desc,
- ftdi_serial, adapter_usb_get_location(), ftdi_channel);
+ adapter_get_required_serial(), adapter_usb_get_location(), ftdi_channel);
if (mpsse_ctx)
break;
}
}
free(ftdi_device_desc);
- free(ftdi_serial);
free(swd_cmd_queue);
return ERROR_OK;
}
-COMMAND_HANDLER(ftdi_handle_serial_command)
-{
- if (CMD_ARGC == 1) {
- free(ftdi_serial);
- ftdi_serial = strdup(CMD_ARGV[0]);
- } else {
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
-
- return ERROR_OK;
-}
-
COMMAND_HANDLER(ftdi_handle_channel_command)
{
if (CMD_ARGC == 1)
.help = "set the USB device description of the FTDI device",
.usage = "description_string",
},
- {
- .name = "serial",
- .handler = &ftdi_handle_serial_command,
- .mode = COMMAND_CONFIG,
- .help = "set the serial number of the FTDI device",
- .usage = "serial_string",
- },
{
.name = "channel",
.handler = &ftdi_handle_channel_command,