/home/epimerde/documents/tc11/CanFestival-3/drivers/timers_unix/timers_unix.c File Reference

#include <stdlib.h>
#include <sys/time.h>
#include <pthread.h>
#include <signal.h>
#include "applicfg.h"
#include "timer.h"

Go to the source code of this file.

Defines

#define maxval(a, b)   ((a>b)?a:b)

Functions

void EnterMutex (void)
void LeaveMutex (void)
void timer_notify (sigval_t val)
void initTimer (void)
void StopTimerLoop (void)
void StartTimerLoop (TimerCallback_t init_callback)
void CreateReceiveTask (CAN_PORT port, TASK_HANDLE *Thread, void *ReceiveLoopPtr)
void WaitReceiveTaskEnd (TASK_HANDLE Thread)
void setTimer (TIMEVAL value)
TIMEVAL getElapsedTime (void)

Variables

pthread_mutex_t CanFestival_mutex = PTHREAD_MUTEX_INITIALIZER
TASK_HANDLE TimerLoopThread
TIMEVAL last_time_set = TIMEVAL_MAX
timeval last_sig
timer_t timer


Define Documentation

#define maxval ( a,
 )     ((a>b)?a:b)

Definition at line 82 of file timers_unix.c.


Function Documentation

void CreateReceiveTask ( CAN_PORT  port,
TASK_HANDLE *  Thread,
void *  ReceiveLoopPtr 
)

Definition at line 71 of file timers_unix.c.

void EnterMutex ( void   ) 

Definition at line 20 of file timers_unix.c.

TIMEVAL getElapsedTime ( void   ) 

Definition at line 98 of file timers_unix.c.

References last_sig.

void initTimer ( void   ) 

Definition at line 39 of file timers_unix.c.

References IO_PORTS_8, last_sig, lock(), TCTL1, TIE, timer, timer_notify(), TIOS, TSCR1, TSCR2, and unlock().

void LeaveMutex ( void   ) 

Definition at line 25 of file timers_unix.c.

void setTimer ( TIMEVAL  value  ) 

Definition at line 83 of file timers_unix.c.

void StartTimerLoop ( TimerCallback_t  init_callback  ) 

Definition at line 62 of file timers_unix.c.

void StopTimerLoop ( void   ) 

Definition at line 55 of file timers_unix.c.

void timer_notify ( sigval_t  val  ) 

Definition at line 30 of file timers_unix.c.

References EnterMutex(), last_sig, LeaveMutex(), and TimeDispatch().

void WaitReceiveTaskEnd ( TASK_HANDLE  Thread  ) 

Definition at line 76 of file timers_unix.c.


Variable Documentation

pthread_mutex_t CanFestival_mutex = PTHREAD_MUTEX_INITIALIZER

Definition at line 10 of file timers_unix.c.

struct timeval last_sig

Definition at line 16 of file timers_unix.c.

TIMEVAL last_time_set = TIMEVAL_MAX

Definition at line 14 of file timers_unix.c.

timer_t timer

Definition at line 18 of file timers_unix.c.

TASK_HANDLE TimerLoopThread

Definition at line 12 of file timers_unix.c.


Generated on Mon Jun 4 16:29:07 2007 for CanFestival by  doxygen 1.5.1