3 #include "kernel_id.h"
\r
4 #include "ecrobot_interface.h"
\r
6 /*--------------------------------------------------------------------------*/
\r
7 /* OSEK declarations */
\r
8 /*--------------------------------------------------------------------------*/
\r
9 DeclareCounter( SysTimerCnt );
\r
10 DeclareResource(lcd);
\r
11 DeclareTask(LowTask);
\r
12 DeclareTask(HighTask);
\r
14 /*--------------------------------------------------------------------------*/
\r
16 /*--------------------------------------------------------------------------*/
\r
19 /*--------------------------------------------------------------------------*/
\r
20 /* Function to be invoked from a category 2 interrupt */
\r
21 /*--------------------------------------------------------------------------*/
\r
22 void user_1ms_isr_type2(void)
\r
27 * Increment OSEK Alarm System Timer Count
\r
29 ercd = SignalCounter( SysTimerCnt );
\r
35 /*--------------------------------------------------------------------------*/
\r
36 /* Task information: */
\r
37 /* ----------------- */
\r
38 /* Name : LowTask */
\r
40 /* Typ : EXTENDED TASK */
\r
41 /* Schedule: preemptive */
\r
42 /*--------------------------------------------------------------------------*/
\r
47 for (hcount = 0; hcount < 10; hcount++) {
\r
51 ecrobot_debug1(digits, hcount, 0);
\r
52 /* The following loop is to wait for the ISR triggered by ecrobot_debug
\r
53 * (or the specific I/O statement inside ecrobot_debug) to complete
\r
54 * This is a good example to show how explicit/implicit shared resource
\r
55 * is needed to be protected against concurrent accesses from multiple Tasks
\r
57 for (lcount = 0; lcount < 3200; lcount++) ;
\r
59 ReleaseResource(lcd);
\r
66 /*--------------------------------------------------------------------------*/
\r
67 /* Task information: */
\r
68 /* ----------------- */
\r
69 /* Name : HighTask */
\r
71 /* Typ : EXTENDED TASK */
\r
72 /* Schedule: preemptive */
\r
73 /*--------------------------------------------------------------------------*/
\r
78 for (hcount = 0; hcount < 10; hcount++) {
\r
81 ecrobot_debug2(digits, hcount, 0);
\r
82 /* The following loop is to wait for the ISR triggered by ecrobot_debug
\r
83 * (or the specific I/O statement inside ecrobot_debug) to complete
\r
84 * This is a good example to show how explicit/implicit shared resource
\r
85 * is needed to be protected against concurrent accesses from multiple Tasks
\r
87 for (lcount = 0; lcount < 3200; lcount++) ;
\r
89 ReleaseResource(lcd);
\r