aboutsummaryrefslogtreecommitdiffstats
path: root/timer.c
diff options
context:
space:
mode:
authorreinelt <>2004-09-19 09:31:19 +0000
committerreinelt <>2004-09-19 09:31:19 +0000
commit75bb1267aab38c6e01a062b73a237fbbff798d66 (patch)
treead638436e04f983332e7937ce0f2bd6329af355c /timer.c
parentde0ea2d2bb15e857583dcb4560d2c7437d386902 (diff)
downloadlcd4linux-75bb1267aab38c6e01a062b73a237fbbff798d66.tar.gz
[lcd4linux @ 2004-09-19 09:31:19 by reinelt]
HD44780 busy flag checking improved: fall back to busy-waiting if too many errors occur
Diffstat (limited to '')
-rw-r--r--timer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/timer.c b/timer.c
index 54c9351..6b65574 100644
--- a/timer.c
+++ b/timer.c
@@ -1,4 +1,4 @@
-/* $Id: timer.c,v 1.10 2004/06/26 12:05:00 reinelt Exp $
+/* $Id: timer.c,v 1.11 2004/09/19 09:31:19 reinelt Exp $
*
* generic timer handling
*
@@ -21,6 +21,9 @@
*
*
* $Log: timer.c,v $
+ * Revision 1.11 2004/09/19 09:31:19 reinelt
+ * HD44780 busy flag checking improved: fall back to busy-waiting if too many errors occur
+ *
* Revision 1.10 2004/06/26 12:05:00 reinelt
*
* uh-oh... the last CVS log message messed up things a lot...
@@ -130,8 +133,6 @@ int timer_add (void (*callback)(void *data), void *data, const int interval, con
int i;
struct timeval now;
- gettimeofday(&now, NULL);
-
/* find a free slot */
for (i=0; i<nTimers; i++) {
if (Timers[i].active==0) break;
@@ -143,6 +144,8 @@ int timer_add (void (*callback)(void *data), void *data, const int interval, con
Timers=realloc(Timers, nTimers*sizeof(*Timers));
}
+ gettimeofday(&now, NULL);
+
/* fill slot */
Timers[i].callback = callback;
Timers[i].data = data;