X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Ftimer_posix.c;h=e6149cead7f43d5e2a3058b381e86716ea2109d0;hb=7af44c59736ad212ad0f7b0269493db8d5122dc5;hp=9814dc245d3677e90cd419b2f86c7e49b0c93040;hpb=bbc33efb70a0062b36cc415452922e7ba69c748f;p=bertos.git diff --git a/drv/timer_posix.c b/drv/timer_posix.c old mode 100755 new mode 100644 index 9814dc24..e6149cea --- a/drv/timer_posix.c +++ b/drv/timer_posix.c @@ -1,8 +1,33 @@ -/*! +/** * \file * * * \version $Id$ @@ -11,17 +36,6 @@ * * \brief Low-level timer module for Qt emulator (implementation). */ - -/*#* - *#* $Log$ - *#* Revision 1.1 2005/11/27 03:58:18 bernie - *#* Add POSIX timer emulator. - *#* - *#* Revision 1.1 2005/11/27 03:06:36 bernie - *#* Qt timer emulation. - *#* - *#*/ - #include // hptime.t #include @@ -34,7 +48,7 @@ void timer_isr(int); /// HW dependent timer initialization. -extern "C" static void timer_hw_init(void) +static void timer_hw_init(void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); @@ -46,17 +60,16 @@ extern "C" 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); } -extern "C" INLINE hptime_t timer_hw_hpread(void) +INLINE hptime_t timer_hw_hpread(void) { return hptime_get(); } -