📄 scheduler.lst
字号:
C51 COMPILER V7.06 SCHEDULER 01/29/2008 10:59:25 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE SCHEDULER
OBJECT MODULE PLACED IN scheduler.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE modules\scheduler\scheduler.c LARGE OPTIMIZE(9,SPEED) INCDIR(.\;.\;.\) DEFI
-NE(KEIL) DEBUG OBJECTEXTEND PRINT(.\scheduler.lst) OBJECT(scheduler.obj)
stmt level source
1 /*C**************************************************************************
2 * NAME: scheduler.c
3 *----------------------------------------------------------------------------
4 * Copyright (c) 2003 Atmel.
5 *----------------------------------------------------------------------------
6 * RELEASE: c5131-usb-kbd-light-1_0_2
7 * REVISION: 1.7
8 *----------------------------------------------------------------------------
9 * PURPOSE:
10 * This file contains the scheduler routines
11 *
12 * NOTES:
13 * Configuration:
14 * - SCHEDULER_TYPE in scheduler.h header file
15 * - Task & init for at least task number 1 must be defined
16 *****************************************************************************/
17
18 /*_____ I N C L U D E S ____________________________________________________*/
19 #include "config.h" /* system definition */
20 #include "scheduler.h" /* scheduler definition */
21
22
23 /*_____ M A C R O S ________________________________________________________*/
24
25
26 /*_____ D E F I N I T I O N ________________________________________________*/
27 #if SCHEDULER_TYPE != SCHEDULER_FREE
/*V**************************************************************************
* NAME: scheduler_tick_flag
*----------------------------------------------------------------------------
* PURPOSE:
* When SCHEDULER_TYPE != SCHEDULER_FREE, this flag control task calls.
*****************************************************************************/
bit scheduler_tick_flag;
#endif
36
37 /*_____ D E C L A R A T I O N ______________________________________________*/
38 /*F**************************************************************************
39 * NAME: scheduler_init
40 *----------------------------------------------------------------------------
41 * PARAMS:
42 *
43 * return:
44 *----------------------------------------------------------------------------
45 * PURPOSE:
46 * Scheduler initialization
47 *----------------------------------------------------------------------------
48 * EXAMPLE:
49 *----------------------------------------------------------------------------
50 * NOTE:
51 * Task_x_init() and Task_x_fct() are defined in config.h
52 *----------------------------------------------------------------------------
53 * REQUIREMENTS:
54 *****************************************************************************/
C51 COMPILER V7.06 SCHEDULER 01/29/2008 10:59:25 PAGE 2
55 void scheduler_init (void)
56 {
57 1 #ifdef Scheduler_time_init
58 1 Scheduler_time_init(); // start time base
59 1 #endif
60 1 #ifdef Scheduler_task_1_init
61 1 Scheduler_task_1_init();
62 1 #endif
63 1 #ifdef Scheduler_task_2_init
Scheduler_task_2_init();
#endif
66 1 #ifdef Scheduler_task_3_init
Scheduler_task_3_init();
#endif
69 1 #ifdef Scheduler_task_4_init
Scheduler_task_4_init();
#endif
72 1 #ifdef Scheduler_task_5_init
Scheduler_task_5_init();
#endif
75 1 #ifdef Scheduler_task_6_init
Scheduler_task_6_init();
#endif
78 1 #ifdef Scheduler_task_7_init
Scheduler_task_7_init();
#endif
81 1 #ifdef Scheduler_task_8_init
Scheduler_task_8_init();
#endif
84 1 #ifdef Scheduler_task_9_init
Scheduler_task_9_init();
#endif
87 1 #ifdef Scheduler_task_10_init
Scheduler_task_10_init();
#endif
90 1 Scheduler_reset_tick_flag();
91 1 }
92
93
94 /*F**************************************************************************
95 * NAME: scheduler_tasks
96 *----------------------------------------------------------------------------
97 * PARAMS:
98 *
99 * return:
100 *----------------------------------------------------------------------------
101 * PURPOSE:
102 * Task execution scheduler
103 *----------------------------------------------------------------------------
104 * EXAMPLE:
105 *----------------------------------------------------------------------------
106 * NOTE:
107 *----------------------------------------------------------------------------
108 * REQUIREMENTS:
109 *****************************************************************************/
110 void scheduler_tasks (void)
111 {
112 1 scheduler_empty_fct(); // only to avoid uncalled segment warning if the empty function is not used
113 1 #ifdef SCHEDULER_ENABLE_IT
Enable_interrupt(); // 80C51 All IT on
#endif
116 1 for(;;)
C51 COMPILER V7.06 SCHEDULER 01/29/2008 10:59:25 PAGE 3
117 1 {
118 2 #ifdef Scheduler_task_1
119 2 Scheduler_task_1();
120 2 Scheduler_call_next_task();
121 2 #endif
122 2 #ifdef Scheduler_task_2
123 2 Scheduler_task_2();
124 2 Scheduler_call_next_task();
125 2 #endif
126 2 #ifdef Scheduler_task_3
Scheduler_task_3();
Scheduler_call_next_task();
#endif
130 2 #ifdef Scheduler_task_4
Scheduler_task_4();
Scheduler_call_next_task();
#endif
134 2 #ifdef Scheduler_task_5
Scheduler_task_5();
Scheduler_call_next_task();
#endif
138 2 #ifdef Scheduler_task_6
Scheduler_task_6();
Scheduler_call_next_task();
#endif
142 2 #ifdef Scheduler_task_7
Scheduler_task_7();
Scheduler_call_next_task();
#endif
146 2 #ifdef Scheduler_task_8
Scheduler_task_8();
Scheduler_call_next_task();
#endif
150 2 #ifdef Scheduler_task_9
Scheduler_task_9();
Scheduler_call_next_task();
#endif
154 2 #ifdef Scheduler_task_10
Scheduler_task_10();
Scheduler_call_next_task();
#endif
158 2 Scheduler_new_schedule();
159 2 }
160 1 }
161
162
163 /*F**************************************************************************
164 * NAME: scheduler
165 *----------------------------------------------------------------------------
166 * PARAMS:
167 *
168 * return:
169 *----------------------------------------------------------------------------
170 * PURPOSE:
171 * Simply call this task to init & run the scheduler
172 *----------------------------------------------------------------------------
173 * EXAMPLE:
174 *----------------------------------------------------------------------------
175 * NOTE:
176 *----------------------------------------------------------------------------
177 * REQUIREMENTS:
178 *****************************************************************************/
C51 COMPILER V7.06 SCHEDULER 01/29/2008 10:59:25 PAGE 4
179 void scheduler (void)
180 {
181 1 scheduler_init();
182 1 scheduler_tasks();
183 1 }
184
185
186 /*F**************************************************************************
187 * NAME: scheduler_empty_fct
188 *----------------------------------------------------------------------------
189 * PARAMS:
190 *
191 * return:
192 *----------------------------------------------------------------------------
193 * PURPOSE:
194 * This function does nothing
195 *----------------------------------------------------------------------------
196 * EXAMPLE:
197 *----------------------------------------------------------------------------
198 * NOTE:
199 *----------------------------------------------------------------------------
200 * REQUIREMENTS:
201 *****************************************************************************/
202 void scheduler_empty_fct (void)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -