# HG changeset patch # User etisserant # Date 1150719563 -7200 # Node ID c767eabbaaac8d024cb0d54252c8ebf64468256d # Parent 8afa336923725fc9d47c120b10a427a189b87c54 Fixed some bugs with Xenomai and CAN/peak diff -r 8afa33692372 -r c767eabbaaac drivers/can_peak/can_peak.c --- a/drivers/can_peak/can_peak.c Fri Jun 16 14:44:23 2006 +0200 +++ b/drivers/can_peak/can_peak.c Mon Jun 19 14:19:23 2006 +0200 @@ -62,7 +62,10 @@ UNS8 data; TPCANMsg peakMsg; if ((errno = CAN_Read(((CANPort*)fd0)->fd, & peakMsg))) { // Blocks until no new message or error. - perror("!!! Peak board : error of reading. (from f_can_receive function) \n"); + if(errno != -EIDRM) // error is not "Can Port closed while reading" + { + perror("!!! Peak board : error of reading. (from f_can_receive function) \n"); + } return 1; } m->cob_id.w = peakMsg.ID; @@ -159,7 +162,7 @@ int canClose(CAN_HANDLE fd0) { CAN_Close(((CANPort*)fd0)->fd); + WaitReceiveTaskEnd(&((CANPort*)fd0)->receiveTask); ((CANPort*)fd0)->used = 0; - WaitReceiveTaskEnd(&((CANPort*)fd0)->receiveTask); return 0; } diff -r 8afa33692372 -r c767eabbaaac drivers/timers_xeno/timers_xeno.c --- a/drivers/timers_xeno/timers_xeno.c Fri Jun 16 14:44:23 2006 +0200 +++ b/drivers/timers_xeno/timers_xeno.c Mon Jun 19 14:19:23 2006 +0200 @@ -52,8 +52,9 @@ EnterMutex(); TimeDispatch(); LeaveMutex(); - }while ((ret = rt_task_sleep_until(last_alarm_set)) == 0); - }while (ret == -EINTR && !stop_timer ); + while ((ret = rt_task_sleep_until(last_alarm_set)) == -EINTR); + }while (ret == 0); + }while (!stop_timer); printf("End of TimerLoop, code %d\n",ret); } @@ -86,7 +87,8 @@ goto error; } - + return; + error: cleanup_all(); }