main.lst
来自「STC51系列的源码」· LST 代码 · 共 125 行
LST
125 行
C51 COMPILER V8.12 MAIN 12/03/2008 09:22:34 PAGE 1
C51 COMPILER V8.12, 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 "../UART/UART.h"
9 #include "../PCC/PCC.h"
10 #include "../LED/LED.h"
11 #include "../SEG7/SEG7.h"
12 #include "../HC595/HC595.h"
13 #include "../DS18B20/DS18B20.h"
14
15 unsigned int system_timer=0x00; //* 这是系统需要的定时器变量
16
17 /********************************************************************************/
18 /* funname : MAIN_ds18b20_hook() */
19 /* created : xillinx */
20 /* time : 2008-08-06 */
21 /* descript: DS18B20启动转换HOOK函数 */
22 /********************************************************************************/
23 void MAIN_ds18b20_hook(void)
24 { DS18B20_mflag=0x1;
25 1 }
26
27
28 /********************************************************************************/
29 /* funname : MAIN_pcc_ds18b20() */
30 /* created : xillinx */
31 /* time : 2008-08-06 */
32 /* descript: DS18B20调试输出 */
33 /********************************************************************************/
34 void MAIN_pcc_ds18b20(void)
35 { unsigned char buffer[0x2];
36 1 int mdata;
37 1 if(DS18B20_mflag==0x0)
38 1 { return;
39 2 }
40 1 DS18B20_mflag=0x0;
41 1 mdata=(int)DSB20_read_temperature();
42 1 DSB20_delay_100_us();
43 1 DSB20_start_convert();
44 1 buffer[0x0]=(mdata>>0x0)&0xFF;
45 1 buffer[0x1]=(mdata>>0x8)&0xFF;
46 1 PCC_send_mdata('T',buffer,0x2);
47 1 return;
48 1 }
49
50 /********************************************************************************/
51 /* fun_name : MAIN_interrupt_hook_process() */
52 /* version : v1.00 */
53 /* created : xillinx */
54 /* descript : 定时器钩子函数的处理,如果需要使用这些函数,需要重新挂接,如果不需要 */
55 /* 不需要做任何事情 */
C51 COMPILER V8.12 MAIN 12/03/2008 09:22:34 PAGE 2
56 /********************************************************************************/
57 void MAIN_interrupt_hook_process (void)
58 { CPU_001_tick_process = CPU_interrupt_proc_null; //* 定时器钩子函数的缺省处理,如果需要使用这些函数,需要
-重新挂接
59 1 CPU_002_tick_process = CPU_interrupt_proc_null;
60 1 CPU_004_tick_process = CPU_interrupt_proc_null;
61 1 CPU_008_tick_process = CPU_interrupt_proc_null;
62 1 CPU_010_tick_process = CPU_interrupt_proc_null;
63 1 CPU_020_tick_process = CPU_interrupt_proc_null;
64 1 CPU_040_tick_process = CPU_interrupt_proc_null;
65 1 CPU_080_tick_process = CPU_interrupt_proc_null;
66 1 CPU_100_tick_process = CPU_interrupt_proc_null;
67 1 CPU_200_tick_process = CPU_interrupt_proc_null; //* 2x 512MS=1024MS
68 1 CPU_400_tick_process = CPU_interrupt_proc_null; //* 2x1024MS=2048MS
69 1 CPU_extern_0_process = CPU_interrupt_proc_null;
70 1 CPU_extern_1_process = CPU_interrupt_proc_null;
71 1 CPU_timer_02_process = CPU_interrupt_proc_null;
72 1 //* 重新挂接HOOK函数
73 1 CPU_001_tick_process = HC595_refresh; //* 2MS
74 1 CPU_080_tick_process = LED_refresh; //* 128x2=256MS
75 1 CPU_400_tick_process = MAIN_ds18b20_hook; //* 2秒钟启动一次转换
76 1 }
77
78 /********************************************************************************/
79 /* function : main() */
80 /* recension: xillinx */
81 /* descript : 主函数入口 */
82 /********************************************************************************/
83 void main (void)
84 { unsigned int delax=0x8000;
85 1 while(delax--)
86 1 { ;
87 2 }
88 1 UART_buffer_initilize();
89 1 MAIN_interrupt_hook_process(); //* CPU的挂接函数处理
90 1 CPU_source_initialize(); //* 控制CPU的资源
91 1 SEG7_clear_screen();
92 1 SEG7_printf_ascii("568912.567"); //* 测试七段数码管
93 1 DSB20_initialize();
94 1 while(1)
95 1 { MAIN_pcc_ds18b20();
96 2 }
97 1 }
98
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 342 ----
CONSTANT SIZE = 11 ----
XDATA SIZE = 2 4
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 + -
显示快捷键?