📄 config.lst
字号:
C51 COMPILER V9.00 CONFIG 11/09/2010 16:31:12 PAGE 1
C51 COMPILER V9.00, COMPILATION OF MODULE CONFIG
OBJECT MODULE PLACED IN config.OBJ
COMPILER INVOKED BY: D:\Program Files\KEIL C V4\C51\BIN\C51.EXE config.c LARGE BROWSE DEBUG OBJECTEXTEND
line level source
*** WARNING C500 IN LINE 1 OF CONFIG.C: LICENSE ERROR (R208: RENEW LICENSE ID CODE (LIC))
1
2 #include "reg24le1.h"
3 #include "config.h"
4 #include "intrins.h"
5 #include "Sys.h"
6
7 volatile unsigned char Udata;
8
9
10 void system_init(void)
11 {
12 1 EA = 0;
13 1
14 1 // CLK
15 1 CLKCTRL = 0x28; // Clock sourced by XCOSC16M
16 1 CLKLFCTRL = 0x01; // RCOSC32K
17 1 Timer_Ms(50);
18 1 // RF
19 1 SPIRCON1 = 0x0B;
20 1 RFCKEN = 1; // enable L01 clock
21 1 RF = 0;
22 1 // INTERRUPT
23 1 WUIRQ = 0; // wakeup int enabled
24 1 P0DIR&=0X7F;
25 1 P07=0;
26 1 }
27
28
29 //---------------------------------------------------------------------------
30 void Uart_Init(void)
31 {
32 1 // UART
33 1
34 1 P0DIR &= 0xF7; // P03 (TxD) is output
35 1 P0DIR |= 0x10; // P04 (RxD) is input
36 1 S0CON = 0x50;
37 1 PCON |= 0x80; // SMOD = 1
38 1 WDCON |= 0x80; // Select internal baud rate generator
39 1
40 1 S0RELL = 0x30; // BAUD_38K4 //2400
41 1 S0RELH = 0x03;
42 1 //ES0 = 1; // Enable UART0 interrupt
43 1 }
44
45 //---------------------------------------------------------------------------
46 //
47 // 等待指定的微秒数
48 //
49 //---------------------------------------------------------------------------
50 void Timer_Us(void)
51 {
52 1 _nop_();_nop_();_nop_();_nop_();
53 1 _nop_();_nop_();_nop_();_nop_();
54 1 _nop_();_nop_();_nop_();_nop_();
C51 COMPILER V9.00 CONFIG 11/09/2010 16:31:12 PAGE 2
55 1
56 1 _nop_();_nop_();_nop_();_nop_();
57 1 _nop_();_nop_();_nop_();
58 1
59 1 }
60
61 //---------------------------------------------------------------------------
62 void Timer_10Us(unsigned char nTime)
63 {
64 1 while((nTime--)!=0) Timer_Us();
65 1 }
66
67
68 //---------------------------------------------------------------------------
69 //
70 // 等待指定的毫秒数
71 //
72 //---------------------------------------------------------------------------
73
74 void Timer_Ms(int nTime)
75 {
76 1 int j;
77 1 while((nTime--)!=0)
78 1 for( j = 0; j < 350; j++);
79 1 }
80
81
82
83 void hal_wdog_init(unsigned int start_value)
84 {
85 1 WDSV = LSB(start_value); // Write the 8 LSB to the WD counter
86 1 WDSV = MSB(start_value); // Write the 8 MSB to the WD counter
87 1 }
88
89 //---------------------------------------------------------------------------
90 void hal_wdog_restart(void)
91 {
92 1 unsigned char wd_msb, wd_lsb;
93 1
94 1 wd_lsb = WDSV;
95 1 wd_msb = WDSV;
96 1
97 1 WDSV = wd_lsb; // Write the 8 LSB to the WD counter
98 1 WDSV = wd_msb; // Write the 8 MSB to the WD counter
99 1 }
100
101 //---------------------------------------------------------------------------
102
103 //---------------------------------------------------------------------------
104 static void ifp_interrupt(void) interrupt INTERRUPT_IFP { }
105 //---------------------------------------------------------------------------
106 static void tf0_interrupt(void) interrupt INTERRUPT_TF0
107 {
108 1 // 时钟中断函数(1ms发生一次)
109 1 TH0 = 0xFA;
110 1 TL0 = 0xCA;
111 1 }
112 //---------------------------------------------------------------------------
113 static void pofirq_interrupt(void) interrupt INTERRUPT_POFIRQ {}
114 //---------------------------------------------------------------------------
115 static void tf1_interrupt(void) interrupt INTERRUPT_TF1 {}
116 //---------------------------------------------------------------------------
C51 COMPILER V9.00 CONFIG 11/09/2010 16:31:12 PAGE 3
117 static void tf2_interrupt(void) interrupt INTERRUPT_TF2 {}
118 //---------------------------------------------------------------------------
119 static void msdone_interrupt(void) interrupt INTERRUPT_MSDONE {}
120 //---------------------------------------------------------------------------
121 static void wuopirq_interrupt(void) interrupt INTERRUPT_WUOPIRQ { }
122 //---------------------------------------------------------------------------
123 static void miscirq_interrupt(void) interrupt INTERRUPT_MISCIRQ {}
124 //---------------------------------------------------------------------------
125 static void tick_interrupt(void) interrupt INTERRUPT_TICK{}
126 //---------------------------------------------------------------------------
127
128 static void ri0_interrupt(void) interrupt INTERRUPT_UART
129 {
130 1 if (RI0 == 1)
131 1 {
132 2 Udata = S0BUF;
133 2 S0BUF = Udata;
134 2
135 2 RI0 = 0;
136 2 }
137 1 else if(TI0 == 1)
138 1 {
139 2 TI0 = 0;
140 2 }
141 1 }
142 //---------------------------------------------------------------------------
143
144
145 //use this to do serial communiacation
146
147 void putchar( unsigned char dat)
148 {
149 1 S0BUF = dat;
150 1 while(!TI0);
151 1 TI0 = 0;
152 1
153 1 }
154
155 void puts( char * s)
156 {
157 1 while(*s!='\0')
158 1 {
159 2 putchar(*s);
160 2 s++;
161 2
162 2 }
163 1
164 1
165 1 }
166
167 char getch(void)
168 {
169 1 char rc;
170 1 if(RI0)
171 1 {
172 2 RI0=0;
173 2 rc=S0BUF;
174 2 }
175 1 return rc;
176 1
177 1 }
178
C51 COMPILER V9.00 CONFIG 11/09/2010 16:31:12 PAGE 4
179 unsigned char keycheck(void)
180 {
181 1
182 1 P1CON=0XD0;//P10
183 1 if(!P10)
184 1 {
185 2 delay(5);
186 2 if(!P10)
187 2 { while(!P10);
188 3 return TRUE; //如果按下就返回真
189 3 }
190 2
191 2 }
192 1 return FALSE; // 返回假
193 1
194 1 }
195
196
197
198
199
200
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 243 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = 1 ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 1 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -