summaryrefslogtreecommitdiff
path: root/src/target/arm720t.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-08-20 07:14:45 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-08-20 07:14:45 +0000
commitc4567145ae8da57070e24824b8727b79dddc99a0 (patch)
tree62be6ae1673be40719eb98a788b13c9fa024859a /src/target/arm720t.c
parente5415575bd0c452c72a8ca3d3547c26f615df593 (diff)
downloadopenocd_libswd-c4567145ae8da57070e24824b8727b79dddc99a0.tar.gz
openocd_libswd-c4567145ae8da57070e24824b8727b79dddc99a0.tar.bz2
openocd_libswd-c4567145ae8da57070e24824b8727b79dddc99a0.tar.xz
openocd_libswd-c4567145ae8da57070e24824b8727b79dddc99a0.zip
fix BUG: keep_alive() error messages
git-svn-id: svn://svn.berlios.de/openocd/trunk@949 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/arm720t.c')
-rw-r--r--src/target/arm720t.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/target/arm720t.c b/src/target/arm720t.c
index 848cbca5..48a6032e 100644
--- a/src/target/arm720t.c
+++ b/src/target/arm720t.c
@@ -24,6 +24,7 @@
#include "arm720t.h"
#include "jtag.h"
#include "log.h"
+#include "time_support.h"
#include <stdlib.h>
#include <string.h>
@@ -366,12 +367,13 @@ int arm720t_soft_reset_halt(struct target_s *target)
arm7_9_common_t *arm7_9 = armv4_5->arch_info;
arm7tdmi_common_t *arm7tdmi = arm7_9->arch_info;
arm720t_common_t *arm720t = arm7tdmi->arch_info;
- int i;
reg_t *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
target_halt(target);
- for (i=0; i<10; i++)
+ long long then=timeval_ms();
+ int timeout;
+ while (!(timeout=((timeval_ms()-then)>1000)))
{
if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0)
{
@@ -381,10 +383,15 @@ int arm720t_soft_reset_halt(struct target_s *target)
{
break;
}
- /* do not eat all CPU, time out after 1 se*/
- alive_sleep(100);
+ if (debug_level>=3)
+ {
+ alive_sleep(100);
+ } else
+ {
+ keep_alive();
+ }
}
- if (i==10)
+ if (timeout)
{
LOG_ERROR("Failed to halt CPU after 1 sec");
return ERROR_TARGET_TIMEOUT;