X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fjtag%2Fat91rm9200.c;h=ff9f7a4126046863c2747b391a9321b2db6431e9;hb=51e9b25c9ae3478989940f925a36d78364d88764;hp=706257533e3a02132a3e447e8126c2f9d44fb235;hpb=9f535f9af7c6b7e8843033049a6da0f6d76d513b;p=fw%2Fopenocd diff --git a/src/jtag/at91rm9200.c b/src/jtag/at91rm9200.c index 706257533..ff9f7a412 100644 --- a/src/jtag/at91rm9200.c +++ b/src/jtag/at91rm9200.c @@ -118,7 +118,7 @@ static void at91rm9200_write(int tck, int tms, int tdi); static void at91rm9200_reset(int trst, int srst); static int at91rm9200_speed(int speed); -static int at91rm9200_register_commands(struct command_context_s *cmd_ctx); +static int at91rm9200_register_commands(struct command_context *cmd_ctx); static int at91rm9200_init(void); static int at91rm9200_quit(void); @@ -185,26 +185,33 @@ static int at91rm9200_speed(int speed) return ERROR_OK; } -static int at91rm9200_handle_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int at91rm9200_handle_device_command(struct command_context *cmd_ctx, char *cmd, char **CMD_ARGV, int argc) { - if (argc == 0) + if (CMD_ARGC == 0) return ERROR_OK; /* only if the device name wasn't overwritten by cmdline */ if (at91rm9200_device == 0) { - at91rm9200_device = malloc(strlen(args[0]) + sizeof(char)); - strcpy(at91rm9200_device, args[0]); + at91rm9200_device = malloc(strlen(CMD_ARGV[0]) + sizeof(char)); + strcpy(at91rm9200_device, CMD_ARGV[0]); } return ERROR_OK; } -static int at91rm9200_register_commands(struct command_context_s *cmd_ctx) +static const struct command_registration at91rm9200_command_handlers[] = { + { + .name = "at91rm9200_device", + .handler = &at91rm9200_handle_device_command, + .mode = COMMAND_CONFIG, + .help = "query armjtagew info", + }, +}; + +static int at91rm9200_register_commands(struct command_context *cmd_ctx) { - register_command(cmd_ctx, NULL, "at91rm9200_device", at91rm9200_handle_device_command, - COMMAND_CONFIG, NULL); - return ERROR_OK; + return register_commands(cmd_ctx, NULL, at91rm9200_command_handlers); } static int at91rm9200_init(void)