break;
case JTAG_SLEEP:
- LOG_DEBUG_IO("sleep %i", cmd->cmd.sleep->us);
+ LOG_DEBUG_IO("sleep %" PRIu32, cmd->cmd.sleep->us);
vsllink_tap_execute();
jtag_sleep(cmd->cmd.sleep->us);
break;
static void vsllink_free_buffer(void)
{
- if (tdi_buffer != NULL) {
- free(tdi_buffer);
- tdi_buffer = NULL;
- }
- if (tdo_buffer != NULL) {
- free(tdo_buffer);
- tdo_buffer = NULL;
- }
- if (tms_buffer != NULL) {
- free(tms_buffer);
- tms_buffer = NULL;
- }
+ free(tdi_buffer);
+ tdi_buffer = NULL;
+
+ free(tdo_buffer);
+ tdo_buffer = NULL;
+
+ free(tms_buffer);
+ tms_buffer = NULL;
}
static int vsllink_quit(void)
libusb_init(&vsllink_handle->libusb_ctx);
if (ERROR_OK != vsllink_usb_open(vsllink_handle)) {
- LOG_ERROR("Can't find USB JTAG Interface!" \
+ LOG_ERROR("Can't find USB JTAG Interface!"
"Please check connection and permissions.");
return ERROR_JTAG_INIT_FAILED;
}
return ERROR_JTAG_QUEUE_FAILED;
}
- if (pending_scan_result->buffer != NULL)
- free(pending_scan_result->buffer);
+ free(pending_scan_result->buffer);
}
}
} else {
static int vsllink_usb_open(struct vsllink *vsllink)
{
ssize_t num_devices, i;
- libusb_device **usb_devices;
+ struct libusb_device **usb_devices;
struct libusb_device_descriptor usb_desc;
struct libusb_device_handle *usb_device_handle;
int retval;
return ERROR_FAIL;
for (i = 0; i < num_devices; i++) {
- libusb_device *device = usb_devices[i];
+ struct libusb_device *device = usb_devices[i];
retval = libusb_get_device_descriptor(device, &usb_desc);
if (retval != 0)
.run = vsllink_swd_run_queue,
};
-struct jtag_interface vsllink_interface = {
- .name = "vsllink",
+static struct jtag_interface vsllink_interface = {
.supported = DEBUG_CAP_TMS_SEQ,
- .commands = vsllink_command_handlers,
+ .execute_queue = vsllink_execute_queue,
+};
+
+struct adapter_driver vsllink_adapter_driver = {
+ .name = "vsllink",
.transports = vsllink_transports,
- .swd = &vsllink_swd_driver,
+ .commands = vsllink_command_handlers,
.init = vsllink_init,
.quit = vsllink_quit,
.reset = vsllink_reset,
- .khz = vsllink_khz,
.speed = vsllink_speed,
+ .khz = vsllink_khz,
.speed_div = vsllink_speed_div,
- .execute_queue = vsllink_execute_queue,
+
+ .jtag_ops = &vsllink_interface,
+ .swd_ops = &vsllink_swd_driver,
};