drivers/timers_unix/timers_unix.c
changeset 145 e747d2e26af0
parent 48 adc6572caf5d
child 149 fe50ada8020b
--- a/drivers/timers_unix/timers_unix.c	Tue Apr 03 20:20:27 2007 +0200
+++ b/drivers/timers_unix/timers_unix.c	Wed Apr 04 13:04:31 2007 +0200
@@ -5,7 +5,6 @@
 #include <signal.h>
 
 #include "applicfg.h"
-#include "can_driver.h"
 #include "timer.h"
 
 pthread_mutex_t CanFestival_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -28,7 +27,7 @@
 	pthread_mutex_unlock(&CanFestival_mutex);
 }
 
-void timer_notify(int val)
+void timer_notify(sigval_t val)
 {
 	gettimeofday(&last_sig,NULL);
 	EnterMutex();
@@ -65,20 +64,15 @@
 	SetAlarm(NULL, 0, init_callback, 0, 0);
 }
 
-void ReceiveLoop(void* arg)
+void CreateReceiveTask(CAN_PORT port, TASK_HANDLE* Thread, void* ReceiveLoopPtr)
 {
-	canReceiveLoop((CAN_HANDLE)arg);
+	pthread_create(Thread, NULL, ReceiveLoopPtr, (void*)port);
 }
 
-void CreateReceiveTask(CAN_HANDLE fd0, TASK_HANDLE* Thread)
+void WaitReceiveTaskEnd(TASK_HANDLE Thread)
 {
-	pthread_create(Thread, NULL, (void *)&ReceiveLoop, (void*)fd0);
-}
-
-void WaitReceiveTaskEnd(TASK_HANDLE *Thread)
-{
-	pthread_kill(*Thread, SIGTERM);
-	pthread_join(*Thread, NULL);
+	pthread_kill(Thread, SIGTERM);
+	pthread_join(Thread, NULL);
 }
 
 #define maxval(a,b) ((a>b)?a:b)