From 62fbb0f545213f8a813819f319e20fee8a859319 Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Mon, 30 Nov 2009 18:45:38 -0800 Subject: target: factor init to 'target init' Adds 'target init' command handler, called as part of 'init'. --- src/openocd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/openocd.c') diff --git a/src/openocd.c b/src/openocd.c index 79a30e77..12bcf443 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -111,11 +111,9 @@ COMMAND_HANDLER(handle_init_command) initialized = 1; - command_context_mode(CMD_CTX, COMMAND_EXEC); - - if (target_init(CMD_CTX) != ERROR_OK) + retval = command_run_line(CMD_CTX, "target init"); + if (ERROR_OK != retval) return ERROR_FAIL; - LOG_DEBUG("target init complete"); if ((retval = jtag_interface_init(CMD_CTX)) != ERROR_OK) { @@ -126,7 +124,6 @@ COMMAND_HANDLER(handle_init_command) /* Try to initialize & examine the JTAG chain at this point, but * continue startup regardless */ - command_context_mode(CMD_CTX, COMMAND_CONFIG); if (command_run_line(CMD_CTX, "jtag init") == ERROR_OK) { command_context_mode(CMD_CTX, COMMAND_EXEC); -- cgit v1.2.3