Commited.

keep_alive() is basically a global kludge that wouldn't be necessary
in ideal world.

Index: C:/workspace/openocd/src/helper/log.c
===================================================================
--- C:/workspace/openocd/src/helper/log.c       (revision 980)
+++ C:/workspace/openocd/src/helper/log.c       (working copy)
@@ -358,6 +358,9 @@
  * 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 @@
        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 */


-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to