diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-15 08:15:59 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-17 11:38:07 -0800 |
commit | 23402315ce01071f30d7ec0c5ca7563ce41f1cc6 (patch) | |
tree | 2b1cad0044d857844f7d6b35b5ffadd390594c9b /src/flash/at91sam7.c | |
parent | 7bf1a86e473a12882bf6f71cb4d0d416394b69d4 (diff) | |
download | riscv-openocd-23402315ce01071f30d7ec0c5ca7563ce41f1cc6.zip riscv-openocd-23402315ce01071f30d7ec0c5ca7563ce41f1cc6.tar.gz riscv-openocd-23402315ce01071f30d7ec0c5ca7563ce41f1cc6.tar.bz2 |
command_handler: change 'args' to CMD_ARGV
This patch converts all instances of 'args' in COMMAND_HANDLER routines
to use CMD_ARGV macro.
Diffstat (limited to 'src/flash/at91sam7.c')
-rw-r--r-- | src/flash/at91sam7.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c index 193bfd3..d23d2b0 100644 --- a/src/flash/at91sam7.c +++ b/src/flash/at91sam7.c @@ -749,20 +749,20 @@ FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command) return ERROR_OK; } - COMMAND_PARSE_NUMBER(u32, args[1], base_address); + COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], base_address); - COMMAND_PARSE_NUMBER(int, args[3], chip_width); - COMMAND_PARSE_NUMBER(int, args[4], bus_width); + COMMAND_PARSE_NUMBER(int, CMD_ARGV[3], chip_width); + COMMAND_PARSE_NUMBER(int, CMD_ARGV[4], bus_width); - COMMAND_PARSE_NUMBER(int, args[8], banks_num); - COMMAND_PARSE_NUMBER(int, args[9], num_sectors); - COMMAND_PARSE_NUMBER(u16, args[10], pages_per_sector); - COMMAND_PARSE_NUMBER(u16, args[11], page_size); - COMMAND_PARSE_NUMBER(u16, args[12], num_nvmbits); + COMMAND_PARSE_NUMBER(int, CMD_ARGV[8], banks_num); + COMMAND_PARSE_NUMBER(int, CMD_ARGV[9], num_sectors); + COMMAND_PARSE_NUMBER(u16, CMD_ARGV[10], pages_per_sector); + COMMAND_PARSE_NUMBER(u16, CMD_ARGV[11], page_size); + COMMAND_PARSE_NUMBER(u16, CMD_ARGV[12], num_nvmbits); if (CMD_ARGC == 14) { unsigned long freq; - COMMAND_PARSE_NUMBER(ulong, args[13], freq); + COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[13], freq); ext_freq = freq * 1000; at91sam7_info->ext_freq = ext_freq; } @@ -774,8 +774,8 @@ FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command) return ERROR_OK; } - target_name = calloc(strlen(args[7]) + 1, sizeof(char)); - strcpy(target_name, args[7]); + target_name = calloc(strlen(CMD_ARGV[7]) + 1, sizeof(char)); + strcpy(target_name, CMD_ARGV[7]); /* calculate bank size */ bank_size = num_sectors * pages_per_sector * page_size; @@ -1120,7 +1120,7 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command) } if (strcmp(bank->driver->name, "at91sam7")) { - command_print(cmd_ctx, "not an at91sam7 flash bank '%s'", args[0]); + command_print(cmd_ctx, "not an at91sam7 flash bank '%s'", CMD_ARGV[0]); return ERROR_FLASH_BANK_INVALID; } if (bank->target->state != TARGET_HALTED) @@ -1129,11 +1129,11 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command) return ERROR_TARGET_NOT_HALTED; } - if (strcmp(args[1], "set") == 0) + if (strcmp(CMD_ARGV[1], "set") == 0) { flashcmd = SGPB; } - else if (strcmp(args[1], "clear") == 0) + else if (strcmp(CMD_ARGV[1], "clear") == 0) { flashcmd = CGPB; } @@ -1152,10 +1152,10 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command) } } - COMMAND_PARSE_NUMBER(int, args[0], bit); + COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], bit); if ((bit < 0) || (bit >= at91sam7_info->num_nvmbits)) { - command_print(cmd_ctx, "gpnvm bit '#%s' is out of bounds for target %s", args[0], at91sam7_info->target_name); + command_print(cmd_ctx, "gpnvm bit '#%s' is out of bounds for target %s", CMD_ARGV[0], at91sam7_info->target_name); return ERROR_OK; } |