diff options
author | Sergey A. Borshch <sb-sf@users.sourceforge.net> | 2013-10-07 11:45:40 +0300 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2013-10-15 20:41:18 +0000 |
commit | 3da319e8b14df3cc33d883a5bd3091e4e4c9da88 (patch) | |
tree | 6fd8f1f48967794c5a0db67e467cde4ce614fff9 | |
parent | ff5ec942d80a34e20b5a3ca3328f7e6a55fb309b (diff) |
hla_target: Update target state when polling
Polling target does not change stste information
except if new state is TARGET_HALTED.
Connecting to the runing target result in target->state
not updated with retrieved value and remains "UNKNOWN"
until 'halt' command issued.
Change-Id: I803d6c0207f7f8699e648779d1df342c9ee7315a
Signed-off-by: Sergey A. Borshch <sb-sf@users.sourceforge.net>
Reviewed-on: http://openocd.zylin.com/1680
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
-rw-r--r-- | src/target/hla_target.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/target/hla_target.c b/src/target/hla_target.c index 568cc88d..abbc1b19 100644 --- a/src/target/hla_target.c +++ b/src/target/hla_target.c @@ -463,11 +463,12 @@ static int adapter_poll(struct target *target) return ERROR_TARGET_FAILURE; } - if (target->state == state) + if (prev_target_state == state) return ERROR_OK; + target->state = state; + if (state == TARGET_HALTED) { - target->state = state; int retval = adapter_debug_entry(target); if (retval != ERROR_OK) |