diff options
author | mzuther <mzuther@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2010-02-06 21:42:05 +0000 |
---|---|---|
committer | mzuther <mzuther@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2010-02-06 21:42:05 +0000 |
commit | fd89168c6b1e62541f8aa683c6d03a1d19eba7e5 (patch) | |
tree | 199f4fd424b5ebce21508bea9c524edba5301aa4 | |
parent | 43aef95679f4be26c5fb99c03d18118de3006f03 (diff) | |
download | lcd4linux-fd89168c6b1e62541f8aa683c6d03a1d19eba7e5.tar.gz |
BUG: compensate timers for processing delay ("timer.c")
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1103 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r-- | timer.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -180,7 +180,6 @@ int timer_process(struct timespec *delay) if (Timers[i].one_shot) { Timers[i].active = 0; } else { - Timers[i].when = now; timer_inc(&Timers[i].when, Timers[i].interval); } } @@ -203,6 +202,9 @@ int timer_process(struct timespec *delay) return -1; } + /* update the current moment to compensate for processing delay */ + gettimeofday(&now, NULL); + /* delay until next timer event */ struct timeval diff; timersub(&Timers[min].when, &now, &diff); |