summaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-10-16 19:44:05 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-10-16 19:44:05 +0000
commit358b472ab8b531d31d0978a892408378f5c820b4 (patch)
treea4fff99224ee0426df713fac74ad5ba8ee9bf0db /src/helper
parent824c270142ee0c30417d686c600bb33920e79aaa (diff)
downloadopenocd+libswd-358b472ab8b531d31d0978a892408378f5c820b4.tar.gz
openocd+libswd-358b472ab8b531d31d0978a892408378f5c820b4.tar.bz2
openocd+libswd-358b472ab8b531d31d0978a892408378f5c820b4.tar.xz
openocd+libswd-358b472ab8b531d31d0978a892408378f5c820b4.zip
sleep command now prints out target debugmsgs w/anything like usable performance
git-svn-id: svn://svn.berlios.de/openocd/trunk@1076 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/command.c7
-rw-r--r--src/helper/log.c8
2 files changed, 10 insertions, 5 deletions
diff --git a/src/helper/command.c b/src/helper/command.c
index d34c402b..9ade320c 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -741,7 +741,12 @@ int handle_sleep_command(struct command_context_s *cmd_ctx, char *cmd, char **ar
busy_sleep(duration);
} else
{
- alive_sleep(duration);
+ long long then=timeval_ms();
+ while ((timeval_ms()-then)<duration)
+ {
+ target_call_timer_callbacks_now();
+ usleep(1000);
+ }
}
return ERROR_OK;
diff --git a/src/helper/log.c b/src/helper/log.c
index f7b2fc96..7ea2a6cb 100644
--- a/src/helper/log.c
+++ b/src/helper/log.c
@@ -400,14 +400,14 @@ void kept_alive()
void alive_sleep(int ms)
{
int i;
- for (i=0; i<ms; i+=500)
+ int napTime=10;
+ for (i=0; i<ms; i+=napTime)
{
int sleep_a_bit=ms-i;
- if (sleep_a_bit>500)
+ if (sleep_a_bit>napTime)
{
- sleep_a_bit=500;
+ sleep_a_bit=napTime;
}
- keep_alive();
usleep(sleep_a_bit*1000);
keep_alive();
}