|
From: <jmk...@us...> - 2003-08-05 03:51:03
|
Update of /cvsroot/emc/rtapi/examples/semaphore
In directory sc8-pr-cvs1:/tmp/cvs-serv18267/examples/semaphore
Modified Files:
Makefile master.c slave.c
Log Message:
minor tweaks, all examples work except for a fifo overflow bug under rtai
Index: Makefile
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/semaphore/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Makefile 19 Jul 2003 02:17:41 -0000 1.2
--- Makefile 5 Aug 2003 03:51:00 -0000 1.3
***************
*** 43,46 ****
--- 43,50 ----
# DO NOT DELETE
+ /home/John/emcdev/rtapi/rtlib/master.o: /home/John/emcdev/rtapi/include/rtapi.h
+ /home/John/emcdev/rtapi/rtlib/master.o: /home/John/emcdev/rtapi/include/rtapi_app.h
/home/John/emcdev/rtapi/rtlib/master.o: common.h
+ /home/John/emcdev/rtapi/rtlib/slave.o: /home/John/emcdev/rtapi/include/rtapi.h
+ /home/John/emcdev/rtapi/rtlib/slave.o: /home/John/emcdev/rtapi/include/rtapi_app.h
/home/John/emcdev/rtapi/rtlib/slave.o: common.h
Index: master.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/semaphore/master.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** master.c 4 Aug 2003 06:00:25 -0000 1.4
--- master.c 5 Aug 2003 03:51:00 -0000 1.5
***************
*** 14,18 ****
rtapi_task_handle master_task; /* the task structure */
static unsigned int master_count = 0;
! enum { MASTER_PERIOD_NSEC = 1000000 }; /* timer period, in nanoseconds */
enum { MASTER_STACKSIZE = 1024 }; /* how big the stack is */
--- 14,19 ----
rtapi_task_handle master_task; /* the task structure */
static unsigned int master_count = 0;
! enum { TIMER_PERIOD_NSEC = 10000000 }; /* timer period, in nanoseconds */
! enum { MASTER_PERIOD_NSEC = 1000000000 }; /* timer period, in nanoseconds */
enum { MASTER_STACKSIZE = 1024 }; /* how big the stack is */
***************
*** 21,24 ****
--- 22,26 ----
{
while (1) {
+ rtapi_print ( "master: giving semaphore, count = %d\n", master_count );
rtapi_sem_give(master_sem);
master_count++;
***************
*** 49,53 ****
/* set the base timer period */
! retval = rtapi_clock_set_period(MASTER_PERIOD_NSEC);
if ( retval != RTAPI_SUCCESS ) {
rtapi_print( "sem master init: rtapi_clock_set_period returned %d\n", retval );
--- 51,55 ----
/* set the base timer period */
! retval = rtapi_clock_set_period(TIMER_PERIOD_NSEC);
if ( retval != RTAPI_SUCCESS ) {
rtapi_print( "sem master init: rtapi_clock_set_period returned %d\n", retval );
Index: slave.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/semaphore/slave.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** slave.c 23 Jul 2003 01:22:49 -0000 1.2
--- slave.c 5 Aug 2003 03:51:00 -0000 1.3
***************
*** 21,24 ****
--- 21,25 ----
rtapi_sem_take(master_sem);
slave_count++;
+ rtapi_print ( "slave: got sem, count = %d\n", slave_count );
}
|