summaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-09-08 07:17:48 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-09-08 07:17:48 +0000
commitbc3474b65d2af1b369a47e4b54566d3e26b88325 (patch)
tree4d50a67755ad53d6e480366099c24ba56650a76b /src/helper
parent3f57d41114a00345f46efdf681f7be805a9d3cf5 (diff)
downloadopenocd+libswd-bc3474b65d2af1b369a47e4b54566d3e26b88325.tar.gz
openocd+libswd-bc3474b65d2af1b369a47e4b54566d3e26b88325.tar.bz2
openocd+libswd-bc3474b65d2af1b369a47e4b54566d3e26b88325.tar.xz
openocd+libswd-bc3474b65d2af1b369a47e4b54566d3e26b88325.zip
keep_alive now invokes target_call_timer_callbacks_now
git-svn-id: svn://svn.berlios.de/openocd/trunk@981 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/log.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/helper/log.c b/src/helper/log.c
index efe5d5bb..8e3dd70c 100644
--- a/src/helper/log.c
+++ b/src/helper/log.c
@@ -358,6 +358,9 @@ char *alloc_printf(const char *format, ...)
* This function will send a keep alive packet if >500ms has passed since last time
* it was invoked.
*
+ * Note that this function can be invoked often, so it needs to be relatively
+ * fast when invoked more often than every 500ms.
+ *
*/
void keep_alive()
{
@@ -365,18 +368,22 @@ void keep_alive()
if (current_time-last_time>1000)
{
LOG_WARNING("BUG: keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (%lld)", current_time-last_time);
- last_time=current_time;
- } else if (current_time-last_time>500)
+ }
+ if (current_time-last_time>500)
{
/* this will keep the GDB connection alive */
LOG_USER_N("%s", "");
+
+ /* also process TCL events (we have to do this from 'log.c' since its
+ * keep_alive() is the only routine guaranteed to be called at least
+ * once per second :( */
+ process_jim_events ();
+
+ /* process any timer events now */
+ target_call_timer_callbacks_now();
+
last_time=current_time;
}
-
- /* also process TCL events (we have to do this from 'log.c' since its
- * keep_alive() is the only routine guaranteed to be called at least
- * once per second :( */
- process_jim_events ();
}
/* reset keep alive timer without sending message */