target: fix init_targets script handling
This fixes an issue when init is called before init_targets has been executed. Make sure init_targets is called before init. Change-Id: Icd5bd4c2a8eea2e399d9de4e331a77560e9672ac Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/235 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
This commit is contained in:
committed by
Peter Stuge
parent
17322b729c
commit
b462316699
@@ -1043,6 +1043,8 @@ static int target_init(struct command_context *cmd_ctx)
|
||||
|
||||
COMMAND_HANDLER(handle_target_init_command)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (CMD_ARGC != 0)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
@@ -1054,6 +1056,10 @@ COMMAND_HANDLER(handle_target_init_command)
|
||||
}
|
||||
target_initialized = true;
|
||||
|
||||
retval = command_run_line(CMD_CTX, "init_targets");
|
||||
if (ERROR_OK != retval)
|
||||
return retval;
|
||||
|
||||
LOG_DEBUG("Initializing targets...");
|
||||
return target_init(CMD_CTX);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user