?? cpu.lst
字號(hào):
136 1 }
137
138
139 /********************************************************************************/
140 /* fun_name : CPU_timer_2_initialize() */
141 /* version : v1.00 */
142 /* created : xillinx */
143 /* descript : 定時(shí)器2初始化,用作紅外部分接收 */
144 /* T=12/OSC=12/44236800=0.01736
145 /********************************************************************************/
146 void CPU_timer_2_initialize(void)
147 { C_T2 =0x00; //* 內(nèi)部定時(shí)器
148 1 T2MOD &=0xFE; //* DCEN=0x0,遞增計(jì)數(shù)器,遞增計(jì)數(shù)到0xFFFF后,溢出,然后在把RCAP2L和RCAP2H加載到TL2和T
-H2
149 1 RCAP2L =0x00; //* 如果溢出了,就重新從0開(kāi)始遞增計(jì)數(shù)
150 1 RCAP2H =0x00;
151 1 TL2 =0x00;
152 1 TH2 =0x00;
153 1 TR2 =0x00;
154 1 }
155
156
157 /********************************************************************************/
158 /* fun_name : CPU_extern_0_interrupt() */
159 /* version : v1.00 */
160 /* created : xillinx */
161 /********************************************************************************/
162 void CPU_extern_0_interrupt(void) interrupt 0
163 { CPU_extern_0_process();
164 1 }
165
166 /********************************************************************************/
167 /* fun_name : CPU_extern_1_interrupt() */
168 /* descript : For USB */
169 /* version : v1.00 */
170 /* created : xillinx */
171 /********************************************************************************/
172 void CPU_extern_1_interrupt(void) interrupt 2
173 { CPU_extern_1_process();
174 1 }
175
176 /********************************************************************************/
177 /* fun_name : CPU_serial_1_interrupt() */
C51 COMPILER V8.02 CPU 09/26/2008 13:29:16 PAGE 4
178 /* version : v1.00 */
179 /* created : xillinx */
180 /* descript : For uart */
181 /********************************************************************************/
182 void CPU_serial_1_interrupt(void) interrupt 4
183 { if( RI==1)
184 1 { RI=0;
185 2 UART_recv_isr_process();
186 2 }
187 1 else if(TI==1)
188 1 { TI=0;
189 2 UART_xmit_isr_process();
190 2 }
191 1 }
192
193 /********************************************************************************/
194 /* fun_name : CPU_source_initialize() */
195 /* version : v1.00 */
196 /* created : xillinx */
197 /* descript : 控制CPU的資源使用 */
198 /********************************************************************************/
199 void CPU_source_initialize (void)
200 { CPU_timer_0_initialize();
201 1 CPU_timer_2_initialize();
202 1 CPU_uart_serial_initial();
203 1 IT0 = 0x1; //* 選擇中斷類(lèi)型: 0<==>低電平,1<==>下降沿
204 1 EX0 = 0x1; //* 外部中斷0
205 1 ET0 = 0x1; //* 定時(shí)器0
206 1 EX1 = 0x0; //* 外部中斷1
207 1 ET1 = 0x0; //* 定時(shí)器1
208 1 ES = 0x1; //* UART串口0
209 1 EA = 0x1; //* 全局中斷控制
210 1 }
211
212
213 /********************************************************************************/
214 /* fun_name : CPU_timer_0_interrupt() */
215 /* version : v1.00 */
216 /* created : xillinx */
217 /********************************************************************************/
218 void CPU_timer_interrupt(void)
219 { CPU_soft_timer_lo++;
220 1 system_timer++; //* for system time operator
221 1 CPU_001_tick_process();
222 1 if((CPU_soft_timer_lo&0x01)==0x0)
223 1 { CPU_002_tick_process();
224 2 }
225 1 if((CPU_soft_timer_lo&0x03)==0x0)
226 1 { CPU_004_tick_process();
227 2 }
228 1 if((CPU_soft_timer_lo&0x07)==0x0)
229 1 { CPU_008_tick_process();
230 2 }
231 1 if((CPU_soft_timer_lo&0x0F)==0x0)
232 1 { CPU_010_tick_process();
233 2 }
234 1 if((CPU_soft_timer_lo&0x1F)==0x0)
235 1 { CPU_020_tick_process();
236 2 }
237 1 if((CPU_soft_timer_lo&0x3F)==0x0)
238 1 { CPU_040_tick_process();
239 2 }
C51 COMPILER V8.02 CPU 09/26/2008 13:29:16 PAGE 5
240 1 if((CPU_soft_timer_lo&0x7F)==0x0)
241 1 { CPU_080_tick_process();
242 2 }
243 1 if((CPU_soft_timer_lo&0xFF)==0x0)
244 1 { CPU_100_tick_process();
245 2 CPU_soft_timer_hi++;
246 2 if((CPU_soft_timer_hi&0x01)==0x0)
247 2 { CPU_200_tick_process();
248 3 }
249 2 if((CPU_soft_timer_hi&0x03)==0x0)
250 2 { CPU_400_tick_process();
251 3 }
252 2 }
253 1 }
254
255
256 /********************************************************************************/
257 /* fun_name : CPU_timer_2_interrupt() */
258 /* descript : 定時(shí)器2中斷 */
259 /* version : v1.00 */
260 /* created : xillinx */
261 /********************************************************************************/
262 void CPU_timer_2_interrupt(void) interrupt 5
263 { TF2=0x0;
264 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 562 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = 44 ----
PDATA SIZE = ---- ----
DATA SIZE = 2 ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -