use COMMAND_HANDLER macro to define all commands
This commit is contained in:
@@ -495,8 +495,7 @@ static int amt_jtagaccel_quit(void)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int amt_jtagaccel_handle_parport_port_command(
|
||||
struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(amt_jtagaccel_handle_parport_port_command)
|
||||
{
|
||||
if (argc == 1)
|
||||
{
|
||||
@@ -519,7 +518,7 @@ static int amt_jtagaccel_handle_parport_port_command(
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int amt_jtagaccel_handle_rtck_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(amt_jtagaccel_handle_rtck_command)
|
||||
{
|
||||
if (argc == 0)
|
||||
{
|
||||
|
||||
@@ -2798,7 +2798,7 @@ static int ft2232_quit(void)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
|
||||
COMMAND_HANDLER(ft2232_handle_device_desc_command)
|
||||
{
|
||||
char *cp;
|
||||
char buf[200];
|
||||
@@ -2832,7 +2832,7 @@ static int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx,
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int ft2232_handle_serial_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
|
||||
COMMAND_HANDLER(ft2232_handle_serial_command)
|
||||
{
|
||||
if (argc == 1)
|
||||
{
|
||||
@@ -2846,7 +2846,7 @@ static int ft2232_handle_serial_command(struct command_context_s* cmd_ctx, char*
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int ft2232_handle_layout_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
|
||||
COMMAND_HANDLER(ft2232_handle_layout_command)
|
||||
{
|
||||
if (argc == 0)
|
||||
return ERROR_OK;
|
||||
@@ -2857,7 +2857,7 @@ static int ft2232_handle_layout_command(struct command_context_s* cmd_ctx, char*
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
|
||||
COMMAND_HANDLER(ft2232_handle_vid_pid_command)
|
||||
{
|
||||
if (argc > MAX_USB_IDS * 2)
|
||||
{
|
||||
@@ -2891,7 +2891,7 @@ static int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int ft2232_handle_latency_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
|
||||
COMMAND_HANDLER(ft2232_handle_latency_command)
|
||||
{
|
||||
if (argc == 1)
|
||||
{
|
||||
|
||||
@@ -541,7 +541,7 @@ static int gw16012_quit(void)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int gw16012_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(gw16012_handle_parport_port_command)
|
||||
{
|
||||
if (argc == 1)
|
||||
{
|
||||
|
||||
@@ -410,7 +410,7 @@ static int parport_quit(void)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int parport_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(parport_handle_parport_port_command)
|
||||
{
|
||||
if (argc == 1)
|
||||
{
|
||||
@@ -431,7 +431,7 @@ static int parport_handle_parport_port_command(struct command_context_s *cmd_ctx
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int parport_handle_parport_cable_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(parport_handle_parport_cable_command)
|
||||
{
|
||||
if (argc == 0)
|
||||
return ERROR_OK;
|
||||
@@ -446,7 +446,7 @@ static int parport_handle_parport_cable_command(struct command_context_s *cmd_ct
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int parport_handle_write_on_exit_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(parport_handle_write_on_exit_command)
|
||||
{
|
||||
if (argc != 1)
|
||||
{
|
||||
|
||||
@@ -752,7 +752,7 @@ static int presto_jtag_speed(int speed)
|
||||
|
||||
static char *presto_serial;
|
||||
|
||||
static int presto_handle_serial_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(presto_handle_serial_command)
|
||||
{
|
||||
if (argc == 1)
|
||||
{
|
||||
|
||||
@@ -603,8 +603,7 @@ static int default_srst_asserted(int *srst_asserted)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int handle_interface_list_command(struct command_context_s *cmd_ctx,
|
||||
char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_interface_list_command)
|
||||
{
|
||||
if (strcmp(cmd, "interface_list") == 0 && argc > 0)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
@@ -619,8 +618,7 @@ static int handle_interface_list_command(struct command_context_s *cmd_ctx,
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int handle_interface_command(struct command_context_s *cmd_ctx,
|
||||
char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_interface_command)
|
||||
{
|
||||
/* check whether the interface is already configured */
|
||||
if (jtag_interface)
|
||||
@@ -664,7 +662,7 @@ static int handle_interface_command(struct command_context_s *cmd_ctx,
|
||||
return ERROR_JTAG_INVALID_INTERFACE;
|
||||
}
|
||||
|
||||
static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_scan_chain_command)
|
||||
{
|
||||
jtag_tap_t *tap;
|
||||
|
||||
@@ -701,7 +699,7 @@ static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cm
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int handle_reset_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_reset_config_command)
|
||||
{
|
||||
int new_cfg = 0;
|
||||
int mask = 0;
|
||||
@@ -897,8 +895,7 @@ next:
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int handle_jtag_nsrst_delay_command(struct command_context_s *cmd_ctx,
|
||||
char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_jtag_nsrst_delay_command)
|
||||
{
|
||||
if (argc > 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
@@ -913,8 +910,7 @@ static int handle_jtag_nsrst_delay_command(struct command_context_s *cmd_ctx,
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int handle_jtag_ntrst_delay_command(struct command_context_s *cmd_ctx,
|
||||
char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_jtag_ntrst_delay_command)
|
||||
{
|
||||
if (argc > 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
@@ -929,8 +925,7 @@ static int handle_jtag_ntrst_delay_command(struct command_context_s *cmd_ctx,
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int handle_jtag_nsrst_assert_width_command(struct command_context_s *cmd_ctx,
|
||||
char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_jtag_nsrst_assert_width_command)
|
||||
{
|
||||
if (argc > 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
@@ -945,8 +940,7 @@ static int handle_jtag_nsrst_assert_width_command(struct command_context_s *cmd_
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int handle_jtag_ntrst_assert_width_command(struct command_context_s *cmd_ctx,
|
||||
char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_jtag_ntrst_assert_width_command)
|
||||
{
|
||||
if (argc > 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
@@ -961,7 +955,7 @@ static int handle_jtag_ntrst_assert_width_command(struct command_context_s *cmd_
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_jtag_khz_command)
|
||||
{
|
||||
if (argc > 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
@@ -990,7 +984,7 @@ static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd,
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int handle_jtag_rclk_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_jtag_rclk_command)
|
||||
{
|
||||
if (argc > 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
@@ -1019,8 +1013,7 @@ static int handle_jtag_rclk_command(struct command_context_s *cmd_ctx, char *cmd
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int handle_jtag_reset_command(struct command_context_s *cmd_ctx,
|
||||
char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_jtag_reset_command)
|
||||
{
|
||||
if (argc != 2)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
@@ -1048,8 +1041,7 @@ static int handle_jtag_reset_command(struct command_context_s *cmd_ctx,
|
||||
return jtag_execute_queue();
|
||||
}
|
||||
|
||||
static int handle_runtest_command(struct command_context_s *cmd_ctx,
|
||||
char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_runtest_command)
|
||||
{
|
||||
if (argc != 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
@@ -1083,7 +1075,7 @@ static bool scan_is_safe(tap_state_t state)
|
||||
}
|
||||
|
||||
|
||||
static int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_irscan_command)
|
||||
{
|
||||
int i;
|
||||
scan_field_t *fields;
|
||||
@@ -1358,7 +1350,7 @@ static int Jim_Command_flush_count(Jim_Interp *interp, int argc, Jim_Obj *const
|
||||
}
|
||||
|
||||
|
||||
static int handle_verify_ircapture_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_verify_ircapture_command)
|
||||
{
|
||||
if (argc > 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
@@ -1379,7 +1371,7 @@ static int handle_verify_ircapture_command(struct command_context_s *cmd_ctx, ch
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int handle_verify_jtag_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_verify_jtag_command)
|
||||
{
|
||||
if (argc > 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
@@ -1400,7 +1392,7 @@ static int handle_verify_jtag_command(struct command_context_s *cmd_ctx, char *c
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int handle_tms_sequence_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(handle_tms_sequence_command)
|
||||
{
|
||||
if (argc > 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
@@ -1325,7 +1325,7 @@ static void vsllink_simple_command(uint8_t command)
|
||||
}
|
||||
}
|
||||
|
||||
static int vsllink_handle_mode_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(vsllink_handle_mode_command)
|
||||
{
|
||||
if (argc != 1) {
|
||||
LOG_ERROR("parameter error, should be one parameter for VID");
|
||||
@@ -1349,7 +1349,7 @@ static int vsllink_handle_mode_command(struct command_context_s *cmd_ctx, char *
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int vsllink_handle_usb_vid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(vsllink_handle_usb_vid_command)
|
||||
{
|
||||
if (argc != 1)
|
||||
{
|
||||
@@ -1361,7 +1361,7 @@ static int vsllink_handle_usb_vid_command(struct command_context_s *cmd_ctx, cha
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int vsllink_handle_usb_pid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(vsllink_handle_usb_pid_command)
|
||||
{
|
||||
if (argc != 1)
|
||||
{
|
||||
@@ -1372,7 +1372,7 @@ static int vsllink_handle_usb_pid_command(struct command_context_s *cmd_ctx, cha
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int vsllink_handle_usb_bulkin_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(vsllink_handle_usb_bulkin_command)
|
||||
{
|
||||
if (argc != 1)
|
||||
{
|
||||
@@ -1387,7 +1387,7 @@ static int vsllink_handle_usb_bulkin_command(struct command_context_s *cmd_ctx,
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int vsllink_handle_usb_bulkout_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(vsllink_handle_usb_bulkout_command)
|
||||
{
|
||||
if (argc != 1)
|
||||
{
|
||||
@@ -1402,7 +1402,7 @@ static int vsllink_handle_usb_bulkout_command(struct command_context_s *cmd_ctx,
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int vsllink_handle_usb_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
COMMAND_HANDLER(vsllink_handle_usb_interface_command)
|
||||
{
|
||||
if (argc != 1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user