|
From: <pa...@us...> - 2003-08-10 22:42:58
|
Update of /cvsroot/emc/rtapi/examples/fifo
In directory sc8-pr-cvs1:/tmp/cvs-serv26115
Modified Files:
common.h fifotask.c
Log Message:
Force the scope of rtf_put() to char
Index: common.h
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/fifo/common.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** common.h 8 Jul 2003 15:54:39 -0000 1.1.1.1
--- common.h 10 Aug 2003 22:42:55 -0000 1.2
***************
*** 3,7 ****
enum { FIFO_KEY = 1 };
! enum { FIFO_SIZE = 100 };
#endif /* COMMON_H */
--- 3,7 ----
enum { FIFO_KEY = 1 };
! enum { FIFO_SIZE = 1024 };
#endif /* COMMON_H */
Index: fifotask.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/fifo/fifotask.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** fifotask.c 10 Aug 2003 21:13:03 -0000 1.10
--- fifotask.c 10 Aug 2003 22:42:55 -0000 1.11
***************
*** 13,21 ****
enum { TIMER_PERIOD_NSEC = 10000000 }; /* timer period, in nanoseconds */
enum { FIFO_PERIOD_NSEC = 1000000000 }; /* timer period, in nanoseconds */
! enum { FIFO_STACKSIZE = 1024 }; /* how big the stack is */
static int count = 0;
static int len = 0;
! static int total =0;
/* task code, executed each timer interrupt */
--- 13,21 ----
enum { TIMER_PERIOD_NSEC = 10000000 }; /* timer period, in nanoseconds */
enum { FIFO_PERIOD_NSEC = 1000000000 }; /* timer period, in nanoseconds */
! enum { FIFO_STACKSIZE = 2048 }; /* how big the stack is */
static int count = 0;
static int len = 0;
! static int total = 0;
/* task code, executed each timer interrupt */
***************
*** 28,46 ****
/* write count to buffer as a 3 digit number */
tmp = count;
! for ( n = 0 ; n < 3 ; n++ ) {
! buffer[2-n] = '0' + ( tmp % 10 );
! tmp /= 10;
! }
buffer[3] = ':';
! /* write 'len' digits of 'len' */
for (n = 0; n < len; n++) {
! buffer[4+n] = '0' + len;
}
! rtapi_fifo_write(fifo, buffer, len+4);
! total += len+4;
! buffer[4+n] = '\0';
! rtapi_print("fifotask: total %d, wrote '%s',\n", total, buffer);
count++;
! len++;
if (len > 9)
len = 0;
--- 28,46 ----
/* write count to buffer as a 3 digit number */
tmp = count;
! for (n = 0; n < 3; n++) {
! buffer[2 - n] = (char) ('0' + (tmp % 10));
! tmp /= 10;
! }
buffer[3] = ':';
! /* write 'len' digits of 'len' */
for (n = 0; n < len; n++) {
! buffer[4 + n] = (char) ('0' + len);
}
! rtapi_fifo_write(fifo, buffer, len + 4);
! total += len + 4;
! buffer[4 + n] = (char) '\0';
! rtapi_print_msg(2, "fifotask: total %d, wrote '%s',\n", total, buffer);
count++;
! len++;
if (len > 9)
len = 0;
***************
*** 88,92 ****
retval = rtapi_task_start(fifo_task, fifo_code,
0, fifo_prio,
! FIFO_STACKSIZE, FIFO_PERIOD_NSEC, RTAPI_NO_FP);
if (retval != RTAPI_SUCCESS) {
rtapi_print("fifotask init: rtapi_task_start failed with %d\n", retval);
--- 88,92 ----
retval = rtapi_task_start(fifo_task, fifo_code,
0, fifo_prio,
! FIFO_STACKSIZE, FIFO_PERIOD_NSEC, 0, RTAPI_NO_FP);
if (retval != RTAPI_SUCCESS) {
rtapi_print("fifotask init: rtapi_task_start failed with %d\n", retval);
|