📄 config.lst
字号:
C51 COMPILER V9.00 CONFIG 11/13/2010 15:06:02 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
6 volatile unsigned char Udata;
7 void delay(unsigned char x)
8 {
9 1 unsigned char di;
10 1 for(;x>0;x--)
11 1 for(di=120;di>0;di--)
12 1 {
13 2 ;
14 2 }
15 1
16 1 }
17
18
19 void system_init(void)
20 {
21 1 EA = 0;
22 1
23 1 // CLK
24 1 CLKCTRL = 0x28; // Clock sourced by XCOSC16M
25 1 CLKLFCTRL = 0x01; // RCOSC32K
26 1
27 1 Timer_Ms(50);
28 1
29 1 // RF
30 1 SPIRCON1 = 0x0B;
31 1 RFCKEN = 1; // enable L01 clock
32 1 RF = 0;
33 1
34 1 // INTERRUPT
35 1 WUIRQ = 0; // wakeup int enabled
36 1 EA = 1; // global interrupt enable
37 1
38 1 }
39
40
41 //---------------------------------------------------------------------------
42 void Uart_Init(void)
43 {
44 1 // UART
45 1
46 1 P0DIR &= 0xF7; // P03 (TxD) is output
47 1 P0DIR |= 0x10; // P04 (RxD) is input
48 1 S0CON = 0x50;
49 1 PCON |= 0x80; // SMOD = 1
50 1 WDCON |= 0x80; // Select internal baud rate generator
51 1
52 1 S0RELL = 0x30; // BAUD_38K4 //2400
53 1 S0RELH = 0x03;
54 1 //ES0 = 1; // Enable UART0 interrupt
C51 COMPILER V9.00 CONFIG 11/13/2010 15:06:02 PAGE 2
55 1 }
56
57 //---------------------------------------------------------------------------
58 //
59 // 等待指定的微秒数
60 //
61 //---------------------------------------------------------------------------
62 void Timer_Us(void)
63 {
64 1 _nop_();_nop_();_nop_();_nop_();
65 1 _nop_();_nop_();_nop_();_nop_();
66 1 _nop_();_nop_();_nop_();_nop_();
67 1
68 1 _nop_();_nop_();_nop_();_nop_();
69 1 _nop_();_nop_();_nop_();
70 1
71 1 }
72
73 //---------------------------------------------------------------------------
74 void Timer_10Us(unsigned char nTime)
75 {
76 1 while((nTime--)!=0) Timer_Us();
77 1 }
78
79
80 //---------------------------------------------------------------------------
81 //
82 // 等待指定的毫秒数
83 //
84 //---------------------------------------------------------------------------
85
86 void Timer_Ms(int nTime)
87 {
88 1 int j;
89 1 while((nTime--)!=0)
90 1 for( j = 0; j < 350; j++);
91 1 }
92
93
94
95 void hal_wdog_init(unsigned int start_value)
96 {
97 1 WDSV = LSB(start_value); // Write the 8 LSB to the WD counter
98 1 WDSV = MSB(start_value); // Write the 8 MSB to the WD counter
99 1 }
100
101 //---------------------------------------------------------------------------
102 void hal_wdog_restart(void)
103 {
104 1 unsigned char wd_msb, wd_lsb;
105 1
106 1 wd_lsb = WDSV;
107 1 wd_msb = WDSV;
108 1
109 1 WDSV = wd_lsb; // Write the 8 LSB to the WD counter
110 1 WDSV = wd_msb; // Write the 8 MSB to the WD counter
111 1 }
112
113 //---------------------------------------------------------------------------
114
115 //---------------------------------------------------------------------------
116 static void ifp_interrupt(void) interrupt INTERRUPT_IFP { }
C51 COMPILER V9.00 CONFIG 11/13/2010 15:06:02 PAGE 3
117 //---------------------------------------------------------------------------
118 static void tf0_interrupt(void) interrupt INTERRUPT_TF0
119 {
120 1 // 时钟中断函数(1ms发生一次)
121 1 TH0 = 0xFA;
122 1 TL0 = 0xCA;
123 1 }
124 //---------------------------------------------------------------------------
125 static void pofirq_interrupt(void) interrupt INTERRUPT_POFIRQ {}
126 //---------------------------------------------------------------------------
127 static void tf1_interrupt(void) interrupt INTERRUPT_TF1 {}
128 //---------------------------------------------------------------------------
129 static void tf2_interrupt(void) interrupt INTERRUPT_TF2 {}
130 //---------------------------------------------------------------------------
131 static void msdone_interrupt(void) interrupt INTERRUPT_MSDONE {}
132 //---------------------------------------------------------------------------
133 static void wuopirq_interrupt(void) interrupt INTERRUPT_WUOPIRQ { }
134 //---------------------------------------------------------------------------
135 static void miscirq_interrupt(void) interrupt INTERRUPT_MISCIRQ {}
136 //---------------------------------------------------------------------------
137 static void tick_interrupt(void) interrupt INTERRUPT_TICK{}
138 //---------------------------------------------------------------------------
139
140 static void ri0_interrupt(void) interrupt INTERRUPT_UART
141 {
142 1 if (RI0 == 1)
143 1 {
144 2 Udata = S0BUF;
145 2 S0BUF = Udata;
146 2
147 2 RI0 = 0;
148 2 }
149 1 else if(TI0 == 1)
150 1 {
151 2 TI0 = 0;
152 2 }
153 1 }
154 //---------------------------------------------------------------------------
155
156
157 //use this to do serial communiacation
158
159 void putchar( unsigned char dat)
160 {
161 1 S0BUF = dat;
162 1 while(!TI0);
163 1 TI0 = 0;
164 1
165 1 }
166
167 void puts( char * s)
168 {
169 1 while(*s!='\0')
170 1 {
171 2 putchar(*s);
172 2 s++;
173 2
174 2 }
175 1
176 1
177 1 }
178
C51 COMPILER V9.00 CONFIG 11/13/2010 15:06:02 PAGE 4
179 char getch(void)
180 {
181 1 char rc;
182 1 if(RI0)
183 1 {
184 2 RI0=0;
185 2 rc=S0BUF;
186 2 }
187 1 return rc;
188 1
189 1 }
190
191 unsigned char keycheck(void)
192 {
193 1
194 1 P1CON=0XD0;//P10
195 1 if(!P10)
196 1 {
197 2 delay(10);
198 2 if(!P10)
199 2 { while(!P10);
200 3 return TRUE; //如果按下就返回真
201 3 }
202 2
203 2 }
204 1 return FALSE; // 返回假
205 1
206 1 }
207
208
209
210
211
212
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 252 ----
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 + -