aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTarek BOCHKATI <tarek.bouchkati@gmail.com>2020-05-31 11:46:56 +0100
committerAntonio Borneo <borneo.antonio@gmail.com>2020-06-06 18:03:12 +0100
commit2d3bbcd56656b5f2a708541d42c6c85371323730 (patch)
treef9c4b896555ecd946d8bcf615e47ba900fe03c2e /src
parentcdb6918c87569e055e56db88b2726538c4617ad6 (diff)
downloadriscv-openocd-2d3bbcd56656b5f2a708541d42c6c85371323730.zip
riscv-openocd-2d3bbcd56656b5f2a708541d42c6c85371323730.tar.gz
riscv-openocd-2d3bbcd56656b5f2a708541d42c6c85371323730.tar.bz2
arm_adi_v5: dap_ti_be_32_quirks_command minor simplification
use handle_command_parse_bool within dap_ti_be_32_quirks_command to make it shorter and simpler. Change-Id: Ice179cc477933b27e27235dc2ade23fe655e233d Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5708 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/target/arm_adi_v5.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index 5f6f1ff..f19514c 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -1878,24 +1878,8 @@ COMMAND_HANDLER(dap_dpreg_command)
COMMAND_HANDLER(dap_ti_be_32_quirks_command)
{
struct adiv5_dap *dap = adiv5_get_dap(CMD_DATA);
- uint32_t enable = dap->ti_be_32_quirks;
-
- switch (CMD_ARGC) {
- case 0:
- break;
- case 1:
- COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], enable);
- if (enable > 1)
- return ERROR_COMMAND_ARGUMENT_INVALID;
- break;
- default:
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
- dap->ti_be_32_quirks = enable;
- command_print(CMD, "TI BE-32 quirks mode %s",
- enable ? "enabled" : "disabled");
-
- return 0;
+ return CALL_COMMAND_HANDLER(handle_command_parse_bool, &dap->ti_be_32_quirks,
+ "TI BE-32 quirks mode");
}
const struct command_registration dap_instance_commands[] = {