]> rtime.felk.cvut.cz Git - CanFestival-3.git/commitdiff
Added more correct signal handling to unix timers.
authoretisserant <etisserant>
Tue, 19 Aug 2008 15:30:13 +0000 (15:30 +0000)
committeretisserant <etisserant>
Tue, 19 Aug 2008 15:30:13 +0000 (15:30 +0000)
drivers/timers_unix/timers_unix.c

index e506ed20c92f5ebca6f8fb87da3c2a52840c8b47..39b8dccfd01f520023d29619159e3d05d6e54f7b 100644 (file)
@@ -73,6 +73,24 @@ void StartTimerLoop(TimerCallback_t init_callback)
        LeaveMutex();
 }
 
+void canReceiveLoop_signal(int sig)
+{
+}
+/* We assume that ReceiveLoop_task_proc is always the same */
+static void (*rtai_ReceiveLoop_task_proc)(CAN_PORT) = NULL;
+
+/**
+ * Enter in realtime and start the CAN receiver loop
+ * @param port
+ */
+void unixtimer_canReceiveLoop(CAN_PORT port)
+{
+       
+    /*get signal*/
+    signal(SIGTERM, canReceiveLoop_signal);
+    rtai_ReceiveLoop_task_proc(port);
+}
+
 void CreateReceiveTask(CAN_PORT port, TASK_HANDLE* Thread, void* ReceiveLoopPtr)
 {
        pthread_create(Thread, NULL, ReceiveLoopPtr, (void*)port);