|
From: <jmk...@us...> - 2003-08-13 06:06:01
|
Update of /cvsroot/emc/rtapi/examples/fifo
In directory sc8-pr-cvs1:/tmp/cvs-serv29419/examples/fifo
Modified Files:
Makefile fifotask.c
Log Message:
major changes to tasks API. Task IDs are now ints, not pointers. More changes on the way. RTAI builds and examples work. RTLinux and sim will be updated once rtai is done.
Index: Makefile
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/fifo/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Makefile 10 Aug 2003 21:13:03 -0000 1.4
--- Makefile 13 Aug 2003 05:55:07 -0000 1.5
***************
*** 50,56 ****
--- 50,62 ----
# DO NOT DELETE
+ /home/John/emcdev/rtapi/lib/fifotask.o: /home/John/emcdev/rtapi/include/rtapi.h
+ /home/John/emcdev/rtapi/lib/fifotask.o: /home/John/emcdev/rtapi/include/rtapi_app.h
/home/John/emcdev/rtapi/lib/fifotask.o: common.h
+ /home/John/emcdev/rtapi/lib/fifousr.o: /home/John/emcdev/rtapi/include/ulapi.h
/home/John/emcdev/rtapi/lib/fifousr.o: common.h
+ /home/John/emcdev/rtapi/rtlib/fifotask.o: /home/John/emcdev/rtapi/include/rtapi.h
+ /home/John/emcdev/rtapi/rtlib/fifotask.o: /home/John/emcdev/rtapi/include/rtapi_app.h
/home/John/emcdev/rtapi/rtlib/fifotask.o: common.h
+ /home/John/emcdev/rtapi/rtlib/fifousr.o: /home/John/emcdev/rtapi/include/ulapi.h
/home/John/emcdev/rtapi/rtlib/fifousr.o: common.h
Index: fifotask.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/fifo/fifotask.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** fifotask.c 11 Aug 2003 04:58:39 -0000 1.13
--- fifotask.c 13 Aug 2003 05:55:07 -0000 1.14
***************
*** 9,13 ****
#include "common.h" /* FIFO_KEY */
! static rtapi_task_handle fifo_task = 0; /* the task structure */
static rtapi_fifo_handle fifo;
enum { TIMER_PERIOD_NSEC = 10000000 }; /* timer period, in nanoseconds */
--- 9,13 ----
#include "common.h" /* FIFO_KEY */
! static int fifo_task; /* the task ID */
static rtapi_fifo_handle fifo;
enum { TIMER_PERIOD_NSEC = 10000000 }; /* timer period, in nanoseconds */
***************
*** 82,97 ****
fifo_prio = rtapi_prio_lowest();
! /* launch the fifo task */
! retval = rtapi_task_new(&fifo_task);
! if (retval != RTAPI_SUCCESS) {
! rtapi_print("fifotask init: rtapi_task_new failed with %d\n", retval);
goto no_task;
}
/* start the fifo task */
! retval = rtapi_task_start(fifo_task, fifo_code,
! 0, fifo_prio,
! FIFO_STACKSIZE, FIFO_PERIOD_NSEC, RTAPI_NOW,
! RTAPI_NO_FP);
if (retval != RTAPI_SUCCESS) {
rtapi_print("fifotask init: rtapi_task_start failed with %d\n", retval);
--- 82,95 ----
fifo_prio = rtapi_prio_lowest();
! /* create the fifo task */
! fifo_task = rtapi_task_new(fifo_code, 0 /* arg */, fifo_prio,
! FIFO_STACKSIZE, RTAPI_NO_FP );
! if (fifo_task < 0) {
! rtapi_print("fifotask init: rtapi_task_new failed with %d\n", fifo_task);
goto no_task;
}
/* start the fifo task */
! retval = rtapi_task_start(fifo_task, FIFO_PERIOD_NSEC, RTAPI_NOW);
if (retval != RTAPI_SUCCESS) {
rtapi_print("fifotask init: rtapi_task_start failed with %d\n", retval);
***************
*** 117,121 ****
int retval;
! retval = rtapi_task_stop(fifo_task);
if (retval != RTAPI_SUCCESS) {
rtapi_print("fifotask exit: rtapi_task_stop failed with %d\n", retval);
--- 115,119 ----
int retval;
! retval = rtapi_task_pause(fifo_task);
if (retval != RTAPI_SUCCESS) {
rtapi_print("fifotask exit: rtapi_task_stop failed with %d\n", retval);
|