X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fjtag%2Fhla%2Fhla_interface.c;h=074e3c2fbaa9d5d73a0c76fb51950ff993661f47;hb=c6460ea36d7eeaf4a0fe4fb1a4c65bb21547afbe;hp=15651763da8eb9bdb36a3021a383180acc3e4a7b;hpb=a40cbd85e08df2c87b200c6053c2a608f3bc16e6;p=fw%2Fopenocd diff --git a/src/jtag/hla/hla_interface.c b/src/jtag/hla/hla_interface.c index 15651763d..074e3c2fb 100644 --- a/src/jtag/hla/hla_interface.c +++ b/src/jtag/hla/hla_interface.c @@ -35,7 +35,20 @@ #include -static struct hl_interface_s hl_if = { {0, 0, { 0 }, { 0 }, HL_TRANSPORT_UNKNOWN, false, -1, false, 7184}, 0, 0 }; +static struct hl_interface_s hl_if = { + .param = { + .device_desc = NULL, + .vid = { 0 }, + .pid = { 0 }, + .transport = HL_TRANSPORT_UNKNOWN, + .connect_under_reset = false, + .initial_interface_speed = -1, + .use_stlink_tcp = false, + .stlink_tcp_port = 7184, + }, + .layout = NULL, + .handle = NULL, +}; int hl_interface_open(enum hl_transports tr) { @@ -122,7 +135,6 @@ static int hl_interface_quit(void) jtag_command_queue_reset(); free((void *)hl_if.param.device_desc); - free((void *)hl_if.param.serial); return ERROR_OK; } @@ -147,7 +159,7 @@ int hl_interface_init_reset(void) static int hl_interface_khz(int khz, int *jtag_speed) { - if (hl_if.layout->api->speed == NULL) + if (!hl_if.layout->api->speed) return ERROR_OK; *jtag_speed = hl_if.layout->api->speed(hl_if.handle, khz, true); @@ -162,10 +174,10 @@ static int hl_interface_speed_div(int speed, int *khz) static int hl_interface_speed(int speed) { - if (hl_if.layout->api->speed == NULL) + if (!hl_if.layout->api->speed) return ERROR_OK; - if (hl_if.handle == NULL) { + if (!hl_if.handle) { /* pass speed as initial param as interface not open yet */ hl_if.param.initial_interface_speed = speed; return ERROR_OK; @@ -224,19 +236,6 @@ COMMAND_HANDLER(hl_interface_handle_device_desc_command) return ERROR_OK; } -COMMAND_HANDLER(hl_interface_handle_serial_command) -{ - LOG_DEBUG("hl_interface_handle_serial_command"); - - if (CMD_ARGC == 1) { - hl_if.param.serial = strdup(CMD_ARGV[0]); - } else { - LOG_ERROR("expected exactly one argument to hl_serial "); - } - - return ERROR_OK; -} - COMMAND_HANDLER(hl_interface_handle_layout_command) { LOG_DEBUG("hl_interface_handle_layout_command"); @@ -340,13 +339,6 @@ static const struct command_registration hl_interface_command_handlers[] = { .help = "set the device description of the adapter", .usage = "description_string", }, - { - .name = "hla_serial", - .handler = &hl_interface_handle_serial_command, - .mode = COMMAND_CONFIG, - .help = "set the serial number of the adapter", - .usage = "serial_string", - }, { .name = "hla_layout", .handler = &hl_interface_handle_layout_command,