/* example0.c */ /* * RTXC Quadros Version 1.0 * Copyright (c) 1999-2003 * Quadros Systems, Inc. * ALL RIGHTS RESERVED * * THE INFORMATION HEREIN IS CONFIDENTIAL AND PROPRIETARY. * UNAUTHORIZED DISCLOSURE OR DISTRIBUTION IS PROHIBITED. */ #include "rtxcapi.h" #include "rtxcuart.h" #include "sysinit.h" #include "kalarm.h" #include "kthread.h" #include "example.h" #include "util.h" /* statistics for example purposes */ unsigned int entry1cnt = 0; unsigned int entry2cnt = 0; unsigned int entry3cnt = 0; unsigned int entry4cnt = 0; unsigned int entry5cnt = 0; unsigned int entry6cnt = 0; /***** Example Initialization *****/ void example_init(void) { printl("\n"); printl("Start typing... characters will be echoed as they are received.\n"); TS_DefAlarmActionArm(SALARM2, SCHEDULETHREAD, THREAD2); } /***** Example Application *****/ void entry_point1(void *p1, void *p2) { entry1cnt++; } void entry_point2(void *p1, void *p2) { entry2cnt++; TS_ScheduleThread(THREAD1); TS_ScheduleThread(THREAD3); } void entry_point3(void *p1, void *p2) { entry3cnt++; } /* * Echo characters received by the UART. */ unsigned int entry4datacnt = 0; /* Number of characters processed by entry_point4. */ void entry_point4(void *p1, void *p2) { #ifdef HAS_UART0 /* { */ char entry4data; while((entry4data = rtxcss_uart_rx()) != '\0') { rtxcss_uart_tx(entry4data); entry4datacnt++; } #endif /* } HAS_UART0 */ entry4cnt++; } /***** Unused Entry Points *****/ void entry_point5(void *p1, void *p2) {} void entry_point6(void *p1, void *p2) {} void uexcptn1(void) {} void uexcptn2(void) {} void example_null_run(void) {} /* end of file - example0.c */