X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Ftimer_posix.c;h=6204885e987408fd5433a8d094723e24c9ca1d65;hb=2a5698ac0ea139d09429b66e4aa785b82adb424b;hp=542798abd868e6df36aab4f385093717e46ed4b8;hpb=3278853417ff353379e9c9b98a03bab687e16167;p=bertos.git diff --git a/drv/timer_posix.c b/drv/timer_posix.c index 542798ab..6204885e 100755 --- a/drv/timer_posix.c +++ b/drv/timer_posix.c @@ -14,6 +14,12 @@ /*#* *#* $Log$ + *#* Revision 1.5 2006/02/21 21:28:02 bernie + *#* New time handling based on TIMER_TICKS_PER_SEC to support slow timers with ticks longer than 1ms. + *#* + *#* Revision 1.4 2006/02/17 22:24:21 bernie + *#* Update POSIX timer emulator. + *#* *#* Revision 1.3 2006/02/10 12:34:52 bernie *#* Remove spurious EXTERN_C. *#* @@ -52,11 +58,11 @@ static void timer_hw_init(void) sa.sa_flags = SA_RESTART; sigaction(SIGALRM, &sa, NULL); - // Setup POSIX realtime timer to interrupt every 10ms. + // Setup POSIX realtime timer to interrupt every 1/TIMER_TICKS_PER_SEC. static struct itimerval itv = { - { 0, 1000 }, /* it_interval */ - { 0, 1000 } /* it_value */ + { 0, 1000000 / TIMER_TICKS_PER_SEC }, /* it_interval */ + { 0, 1000000 / TIMER_TICKS_PER_SEC } /* it_value */ }; setitimer(ITIMER_REAL, &itv, NULL); }