X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Ftimer_posix.c;fp=drv%2Ftimer_posix.c;h=0000000000000000000000000000000000000000;hb=791e167e053bdd9250d34a9a5ccae6ccde4d6679;hp=e6149cead7f43d5e2a3058b381e86716ea2109d0;hpb=faf2f6bfd5933ff75e6cc01e3d48f9277f731d8f;p=bertos.git diff --git a/drv/timer_posix.c b/drv/timer_posix.c deleted file mode 100644 index e6149cea..00000000 --- a/drv/timer_posix.c +++ /dev/null @@ -1,75 +0,0 @@ -/** - * \file - * - * - * \version $Id$ - * - * \author Bernardo Innocenti - * - * \brief Low-level timer module for Qt emulator (implementation). - */ -#include // hptime.t -#include - -#include // sigaction() -#include // setitimer() -#include // memset() - - -// Forward declaration for the user interrupt server routine. -void timer_isr(int); - -/// HW dependent timer initialization. -static void timer_hw_init(void) -{ - struct sigaction sa; - memset(&sa, 0, sizeof(sa)); - - // Setup interrupt callback - sa.sa_handler = timer_isr; - sigemptyset(&sa.sa_mask); - sigaddset(&sa.sa_mask, SIGALRM); - sa.sa_flags = SA_RESTART; - sigaction(SIGALRM, &sa, NULL); - - // Setup POSIX realtime timer to interrupt every 1/TIMER_TICKS_PER_SEC. - static struct itimerval itv = - { - { 0, 1000000 / TIMER_TICKS_PER_SEC }, /* it_interval */ - { 0, 1000000 / TIMER_TICKS_PER_SEC } /* it_value */ - }; - setitimer(ITIMER_REAL, &itv, NULL); -} - -INLINE hptime_t timer_hw_hpread(void) -{ - return hptime_get(); -}