?? scheduler.lst
字號:
C51 COMPILER V7.00 SCHEDULER 04/28/2004 09:31:54 PAGE 1
C51 COMPILER V7.00, COMPILATION OF MODULE SCHEDULER
OBJECT MODULE PLACED IN C:\Documents and Settings\lvxc\桌面\AA\scheduler.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE scheduler.c OPTIMIZE(7,SPEED) BROWSE INCDIR(.\modules\system;.\;.\;.\lib_re
-fd) DEFINE(KEIL) DEBUG OBJECTEXTEND OBJECT(C:\Documents and Settings\lvxc\桌面\AA\scheduler.obj)
stmt level source
1 /*C**************************************************************************
2 * NAME: scheduler.c
3 *----------------------------------------------------------------------------
4 * Copyright (c) 2003 Atmel.
5 *----------------------------------------------------------------------------
6 * RELEASE: snd1c-refd-nf-4_0_3
7 * REVISION: 1.8
8 *----------------------------------------------------------------------------
9 * PURPOSE:
10 * This file contains the scheduler routines
11 *
12 * NOTES:
13 * Configuration:
14 * - SCH_TYPE in scheduler.h header file
15 * - SCH_TIMER in scheduler.h header file
16 * Global Variables:
17 * - gl_cpt_tick: byte in data space
18 * - gl_kbd_tick: byte in data space
19 * - gl_mem_tick: byte in data space
20 *
21 *****************************************************************************/
22
23 /*_____ I N C L U D E S ____________________________________________________*/
24
25 #include "config.h" /* system definition */
26 #include "lib_mcu\timer\timer_drv.h" /* timer definition */
27 #include "scheduler.h" /* scheduler definition */
28
29
30 /*_____ M A C R O S ________________________________________________________*/
31
32
33 /*_____ D E F I N I T I O N ________________________________________________*/
34
35 extern data Byte gl_cpt_tick; /* general tick counter */
36 extern data Byte gl_kbd_tick; /* keypad tick counter */
37 extern data Byte gl_mem_tick; /* memory tick counter */
38 extern data Byte gl_led_tick; /* led tick counter */
39 extern idata Uint16 gl_act_tick; /* led tick counter */
40
41 #if (SCH_TYPE != SCH_FREE)
bit sch_tick_flag;
#endif
44
45
46 /*_____ D E C L A R A T I O N ______________________________________________*/
47
48 static void sch_time_init (void);
49
50
51 /*F**************************************************************************
52 * NAME: sch_scheduler_init
53 *----------------------------------------------------------------------------
54 * PARAMS:
C51 COMPILER V7.00 SCHEDULER 04/28/2004 09:31:54 PAGE 2
55 *
56 * return:
57 *----------------------------------------------------------------------------
58 * PURPOSE:
59 * Scheduler initialization
60 *----------------------------------------------------------------------------
61 * EXAMPLE:
62 *----------------------------------------------------------------------------
63 * NOTE:
64 * Task_x_init() and Task_x_fct() are defined in scheduler.h
65 *----------------------------------------------------------------------------
66 * REQUIREMENTS:
67 *****************************************************************************/
68 void sch_scheduler_init (void)
69 {
70 1 Task_1_init();
71 1 Task_2_init();
72 1 Task_3_init();
73 1 Task_4_init();
74 1 Task_5_init();
75 1 Task_6_init();
76 1 Task_7_init();
77 1 Task_8_init();
78 1 Task_9_init();
79 1 Task_10_init();
80 1 #if (SCH_TYPE != SCH_FREE)
sch_tick_flag = FALSE;
#endif
83 1 sch_time_init(); /* start time base */
84 1 }
85
86
87 /*F**************************************************************************
88 * NAME: sch_scheduler
89 *----------------------------------------------------------------------------
90 * PARAMS:
91 *
92 * return:
93 *----------------------------------------------------------------------------
94 * PURPOSE:
95 * Task execution scheduler
96 *----------------------------------------------------------------------------
97 * EXAMPLE:
98 *----------------------------------------------------------------------------
99 * NOTE:
100 *----------------------------------------------------------------------------
101 * REQUIREMENTS:
102 *****************************************************************************/
103 void sch_scheduler (void)
104 {
105 1 while (1)
106 1 {
107 2 Task_1_fct();
108 2 Sch_call_next_task();
109 2
110 2 Task_2_fct();
111 2 Sch_call_next_task();
112 2
113 2 Task_3_fct();
114 2 Sch_call_next_task();
115 2
116 2 Task_4_fct();
C51 COMPILER V7.00 SCHEDULER 04/28/2004 09:31:54 PAGE 3
117 2 Sch_call_next_task();
118 2
119 2 Task_5_fct();
120 2 Sch_call_next_task();
121 2
122 2 Task_6_fct();
123 2 Sch_call_next_task();
124 2
125 2 Task_7_fct();
126 2 Sch_call_next_task();
127 2
128 2 Task_8_fct();
129 2 Sch_call_next_task();
130 2
131 2 Task_9_fct();
132 2 Sch_call_next_task();
133 2
134 2 Task_10_fct();
135 2 Sch_call_next_task();
136 2
137 2 Sch_new_schedule();
138 2 }
139 1 }
140
141
142 /*F**************************************************************************
143 * NAME: sch_default_fct
144 *----------------------------------------------------------------------------
145 * PARAMS:
146 *
147 * return:
148 *----------------------------------------------------------------------------
149 * PURPOSE:
150 * This function does nothing
151 *----------------------------------------------------------------------------
152 * EXAMPLE:
153 *----------------------------------------------------------------------------
154 * NOTE:
155 *----------------------------------------------------------------------------
156 * REQUIREMENTS:
157 *****************************************************************************/
158 void sch_default_fct (void)
159 {
160 1 }
161
162
163 #if (SCH_TIMER == SCH_TIMER0)
164 /*F**************************************************************************
165 * NAME: sch_time_init
166 *----------------------------------------------------------------------------
167 * PARAMS:
168 *
169 * return:
170 *----------------------------------------------------------------------------
171 * PURPOSE:
172 * Scheduler time base (timer 0) initialization
173 *----------------------------------------------------------------------------
174 * EXAMPLE:
175 *----------------------------------------------------------------------------
176 * NOTE:
177 * mode 16-bit Timer, Time counter
178 * T0_PRIO to be defined in config.h
C51 COMPILER V7.00 SCHEDULER 04/28/2004 09:31:54 PAGE 4
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -