Bug on receiveLoopTask termination corrected
authorlbessard
Tue, 20 Jun 2006 16:56:39 +0200
changeset 35 88812de1d7cc
parent 34 3e24a4d68325
child 36 ff3ba4a90548
Bug on receiveLoopTask termination corrected
drivers/can_peak/can_peak.c
drivers/timers_unix/timers_unix.c
drivers/timers_xeno/timers_xeno.c
src/led.c
--- a/drivers/can_peak/can_peak.c	Mon Jun 19 16:35:12 2006 +0200
+++ b/drivers/can_peak/can_peak.c	Tue Jun 20 16:56:39 2006 +0200
@@ -62,7 +62,7 @@
   UNS8 data; 
   TPCANMsg peakMsg;
   if ((errno = CAN_Read(((CANPort*)fd0)->fd, & peakMsg))) {		// Blocks until no new message or error.
-    if(errno != -EIDRM) // error is not "Can Port closed while reading" 
+    if(errno != -EIDRM && errno != -EPERM) // error is not "Can Port closed while reading" 
     {
     	perror("!!! Peak board : error of reading. (from f_can_receive function) \n");
     }
--- a/drivers/timers_unix/timers_unix.c	Mon Jun 19 16:35:12 2006 +0200
+++ b/drivers/timers_unix/timers_unix.c	Tue Jun 20 16:56:39 2006 +0200
@@ -75,9 +75,10 @@
 	pthread_create(Thread, NULL, (void *)&ReceiveLoop, (void*)fd0);
 }
 
-void WaitReceiveTaskEnd(TASK_HANDLE Thread)
+void WaitReceiveTaskEnd(TASK_HANDLE *Thread)
 {
-	pthread_join(Thread, NULL);
+	pthread_kill(*Thread, SIGTERM);
+	pthread_join(*Thread, NULL);
 }
 
 #define max(a,b) a>b?a:b
--- a/drivers/timers_xeno/timers_xeno.c	Mon Jun 19 16:35:12 2006 +0200
+++ b/drivers/timers_xeno/timers_xeno.c	Tue Jun 20 16:56:39 2006 +0200
@@ -120,9 +120,9 @@
 	}
 }
 
-void WaitReceiveTaskEnd(TASK_HANDLE Thread)
+void WaitReceiveTaskEnd(TASK_HANDLE *Thread)
 {
-	rt_task_delete(&Thread);
+	rt_task_delete(Thread);
 }
 
 //#define max(a,b) a>b?a:b
--- a/src/led.c	Mon Jun 19 16:35:12 2006 +0200
+++ b/src/led.c	Tue Jun 20 16:56:39 2006 +0200
@@ -66,7 +66,7 @@
 
 void led_set_state(CO_Data *d, int state)
 {
-printf("led_set_state(%x)\n", state);
+//printf("led_set_state(%x)\n", state);
 
 	switch(state)
 	{
@@ -236,7 +236,7 @@
 	if (led_seq_index_green > strlen(led_sequence_table[led_sequence_green]))
 		led_seq_index_green = 0;
 
-	led_set_redgreen(d, bits);
+	//led_set_redgreen(d, bits);
 }