main.lst
来自「STC51系列的源码」· LST 代码 · 共 120 行
LST
120 行
C51 COMPILER V8.02 MAIN 09/25/2008 20:18:47 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN MAIN.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE MAIN.c LARGE BROWSE DEBUG OBJECTEXTEND
line level source
1 /********************************************************************************/
2 /* filename : MAIN.c */
3 /* created : xillinx */
4 /* descript : 系统的C函数入口 */
5 /********************************************************************************/
6 #include "../CPU/CPU.h"
7 #include "../CFG/CFG.h"
8 #include "../PCC/PCC.h"
9 #include "../UART/UART.h"
10 #include "../LED/LED.h"
11 #include "../SEG7/SEG7.h"
12 #include "../HC595/HC595.h"
13 #include "../ADC0832/ADC0832.h"
14
15 unsigned int system_timer =0x00; //* 这是系统需要的定时器变量
16 unsigned char ADC0832_mflag=0x0;
17
18 /********************************************************************************/
19 /* funname : MAIN_adc0832_hook() */
20 /* created : xillinx */
21 /* time : 2008-08-06 */
22 /* descript: ADC0832启动转换HOOK函数 */
23 /********************************************************************************/
24 void MAIN_adc0832_hook(void)
25 { ADC0832_mflag=0x1;
26 1 }
27
28
29 /********************************************************************************/
30 /* funname : MAIN_pcc_adc0832() */
31 /* created : xillinx */
32 /* time : 2008-08-06 */
33 /* descript: ADC0832调试输出 */
34 /********************************************************************************/
35 void MAIN_pcc_adc0832(void)
36 { unsigned char mdata;
37 1 if(ADC0832_mflag==0x0)
38 1 { return;
39 2 }
40 1 ADC0832_mflag=0x0;
41 1 mdata=(int)ADC_read_channel(0x0);
42 1 PCC_send_mdata('A',&mdata,0x1);
43 1 return;
44 1 }
45
46 /********************************************************************************/
47 /* fun_name : MAIN_interrupt_hook_process() */
48 /* version : v1.00 */
49 /* created : xillinx */
50 /* descript : 定时器钩子函数的处理,如果需要使用这些函数,需要重新挂接,如果不需要 */
51 /* 不需要做任何事情 */
52 /********************************************************************************/
53 void MAIN_interrupt_hook_process (void)
54 { CPU_001_tick_process = CPU_interrupt_proc_null; //* 定时器钩子函数的缺省处理,如果需要使用这些函数,需要
-重新挂接
C51 COMPILER V8.02 MAIN 09/25/2008 20:18:47 PAGE 2
55 1 CPU_002_tick_process = CPU_interrupt_proc_null;
56 1 CPU_004_tick_process = CPU_interrupt_proc_null;
57 1 CPU_008_tick_process = CPU_interrupt_proc_null;
58 1 CPU_010_tick_process = CPU_interrupt_proc_null;
59 1 CPU_020_tick_process = CPU_interrupt_proc_null;
60 1 CPU_040_tick_process = CPU_interrupt_proc_null;
61 1 CPU_080_tick_process = CPU_interrupt_proc_null;
62 1 CPU_100_tick_process = CPU_interrupt_proc_null;
63 1 CPU_200_tick_process = CPU_interrupt_proc_null; //* 2x 512MS=1024MS
64 1 CPU_400_tick_process = CPU_interrupt_proc_null; //* 2x1024MS=2048MS
65 1 CPU_extern_0_process = CPU_interrupt_proc_null;
66 1 CPU_extern_1_process = CPU_interrupt_proc_null;
67 1 CPU_timer_02_process = CPU_interrupt_proc_null;
68 1 //* 重新挂接HOOK函数
69 1 CPU_001_tick_process = HC595_refresh; //* 2MS
70 1 CPU_080_tick_process = LED_refresh; //* 128x2=256MS
71 1 CPU_100_tick_process = MAIN_adc0832_hook; //* 512MS钟启动一次转换
72 1 }
73
74 /********************************************************************************/
75 /* function : main() */
76 /* recension: xillinx */
77 /* descript : 主函数入口 */
78 /********************************************************************************/
79 void main (void)
80 { unsigned int delax=0x8000;
81 1 while(delax--)
82 1 { ;
83 2 }
84 1 UART_buffer_initilize();
85 1 MAIN_interrupt_hook_process(); //* CPU的挂接函数处理
86 1 CPU_source_initialize(); //* 控制CPU的资源
87 1 SEG7_clear_screen();
88 1 SEG7_printf_ascii("568912.567"); //* 测试七段数码管
89 1 while(1)
90 1 { MAIN_pcc_adc0832();
91 2 }
92 1 }
93
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 312 ----
CONSTANT SIZE = 11 ----
XDATA SIZE = 3 1
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?