summaryrefslogtreecommitdiff
path: root/src/openocd.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-30 18:45:38 -0800
committerZachary T Welch <zw@superlucidity.net>2009-12-02 13:26:23 -0800
commit62fbb0f545213f8a813819f319e20fee8a859319 (patch)
treeb55d89777934a3f21478e6f083ed85f2918479e6 /src/openocd.c
parente03f3c57a52b36eac18a673fd3515b5ebac3f08d (diff)
downloadopenocd+libswd-62fbb0f545213f8a813819f319e20fee8a859319.tar.gz
openocd+libswd-62fbb0f545213f8a813819f319e20fee8a859319.tar.bz2
openocd+libswd-62fbb0f545213f8a813819f319e20fee8a859319.tar.xz
openocd+libswd-62fbb0f545213f8a813819f319e20fee8a859319.zip
target: factor init to 'target init'
Adds 'target init' command handler, called as part of 'init'.
Diffstat (limited to 'src/openocd.c')
-rw-r--r--src/openocd.c7
1 files changed, 2 insertions, 5 deletions
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);