|
From: <pa...@us...> - 2003-08-10 23:52:38
|
Update of /cvsroot/emc/rtapi/src/rtapi
In directory sc8-pr-cvs1:/tmp/cvs-serv4147/src/rtapi
Modified Files:
rtai_rtapi.c rtapi.h sim_rtapi.c
Log Message:
Checks on rtapi_task_start() start time made..
Index: rtai_rtapi.c
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtai_rtapi.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** rtai_rtapi.c 10 Aug 2003 22:44:11 -0000 1.17
--- rtai_rtapi.c 10 Aug 2003 23:52:35 -0000 1.18
***************
*** 397,403 ****
}
if (period_nsec > 0) {
/* start the task in periodic mode */
! retval = rt_task_make_periodic(&(task->ostask), rt_get_time(),
nano2count((RTIME) period_nsec));
if (retval != 0) {
--- 397,410 ----
}
+ if (when == NOW) {
+ when = rt_get_time() + 5; /* give it time to get the task running */
+ } else {
+ if (when < (rt_get_time() + 5)) {
+ return RTAPI_LATE;
+ }
+ }
if (period_nsec > 0) {
/* start the task in periodic mode */
! retval = rt_task_make_periodic(&(task->ostask), when,
nano2count((RTIME) period_nsec));
if (retval != 0) {
Index: rtapi.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtapi.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** rtapi.h 10 Aug 2003 22:44:11 -0000 1.15
--- rtapi.h 10 Aug 2003 23:52:35 -0000 1.16
***************
*** 220,223 ****
--- 220,224 ----
#define RTAPI_NO_FP 0
#define RTAPI_USES_FP 1
+ #define NOW 0
extern int rtapi_task_start(rtapi_task_handle task,
***************
*** 358,361 ****
--- 359,369 ----
extern int rtapi_fifo_delete(rtapi_fifo_handle fifo);
+
+ /** FIFO notes. These comments apply to both read and write functions. *
+ * A fifo is a character device, an int is typically four bytes long... *
+ * If less than four bytes are sent to the fifo, expect corrupt data *
+ * out of the other end ! *
+ * The RTAI programming manual clearly states that the programmer is *
+ * responsible for the data format and integrity. */
/** 'rtapi_fifo_read()' reads data from 'fifo'. 'buf' is a buffer for *
Index: sim_rtapi.c
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/sim_rtapi.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** sim_rtapi.c 9 Aug 2003 19:43:09 -0000 1.6
--- sim_rtapi.c 10 Aug 2003 23:52:35 -0000 1.7
***************
*** 172,176 ****
int arg, int prio,
unsigned long int stacksize,
! unsigned long int period_nsec, unsigned char uses_fp)
{
int retval;
--- 172,177 ----
int arg, int prio,
unsigned long int stacksize,
! unsigned long int period_nsec,
! unsigned long long when, unsigned char uses_fp)
{
int retval;
|