aboutsummaryrefslogtreecommitdiffstats
path: root/timer.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-09-19 09:31:19 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-09-19 09:31:19 +0000
commit35e7434afbf825b540210ae1c72c49a18baecc5a (patch)
treead638436e04f983332e7937ce0f2bd6329af355c /timer.c
parent95a086eefd2432170c6aec78953fdc22070d7b93 (diff)
downloadlcd4linux-35e7434afbf825b540210ae1c72c49a18baecc5a.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 git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@491 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'timer.c')
-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;