uint32_t min_freq;
uint32_t max_freq;
+ trace_enabled = enabled;
+
if (!jaylink_has_cap(caps, JAYLINK_DEV_CAP_SWO)) {
- LOG_ERROR("Trace capturing is not supported by the device.");
- return ERROR_FAIL;
- }
+ if (!enabled)
+ return ERROR_OK;
- if (pin_protocol != TPIU_PIN_PROTOCOL_ASYNC_UART) {
- LOG_ERROR("Selected pin protocol is not supported.");
+ LOG_ERROR("Trace capturing is not supported by the device.");
return ERROR_FAIL;
}
- trace_enabled = enabled;
-
ret = jaylink_swo_stop(devh);
if (ret != JAYLINK_OK) {
return ERROR_OK;
}
+ if (pin_protocol != TPIU_PIN_PROTOCOL_ASYNC_UART) {
+ LOG_ERROR("Selected pin protocol is not supported.");
+ return ERROR_FAIL;
+ }
+
buffer_size = calculate_trace_buffer_size();
if (!buffer_size) {
} else if (CMD_ARGC == 1) {
str = CMD_ARGV[0];
- if ((strlen(str) != 17) || (str[2] != ':' || str[5] != ':' || \
+ if ((strlen(str) != 17) || (str[2] != ':' || str[5] != ':' ||
str[8] != ':' || str[11] != ':' || str[14] != ':')) {
command_print(CMD, "Invalid MAC address format.");
return ERROR_COMMAND_SYNTAX_ERROR;
static const char * const jlink_transports[] = { "jtag", "swd", NULL };
-struct jtag_interface jlink_interface = {
+static struct jtag_interface jlink_interface = {
+ .execute_queue = &jlink_execute_queue,
+};
+
+struct adapter_driver jlink_adapter_driver = {
.name = "jlink",
- .commands = jlink_command_handlers,
.transports = jlink_transports,
- .swd = &jlink_swd,
- .execute_queue = &jlink_execute_queue,
- .speed = &jlink_speed,
- .speed_div = &jlink_speed_div,
- .khz = &jlink_khz,
+ .commands = jlink_command_handlers,
+
.init = &jlink_init,
.quit = &jlink_quit,
.reset = &jlink_reset_safe,
+ .speed = &jlink_speed,
+ .khz = &jlink_khz,
+ .speed_div = &jlink_speed_div,
.config_trace = &config_trace,
.poll_trace = &poll_trace,
+
+ .jtag_ops = &jlink_interface,
+ .swd_ops = &jlink_swd,
};