📄 ceshi.lst
字号:
C51 COMPILER V6.12 CESHI 04/29/2009 11:44:37 PAGE 1
C51 COMPILER V6.12, COMPILATION OF MODULE CESHI
OBJECT MODULE PLACED IN ceshi.obj
COMPILER INVOKED BY: E:\Keil\C51\BIN\C51.EXE .\sucess\ceshi.c DEBUG OBJECTEXTEND PRINT(.\ceshi.lst) OBJECT(ceshi.obj)
stmt level source
1 #include<reg52.h>
2 #include<stdio.h>
3 #include<intrins.h>
4
5 #define uchar unsigned char
6 #define uint unsigned int;
7
8 sbit dula=P2^6;
9 sbit wela=P2^7;
10 sbit dq=P2^2;
11 sbit feng=P2^3;
12
13 uint c1_temper;
14 uint L_temper;
15 uint H_temper;
16
17 uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66, 0x6d,0x7d,0x07,0x7f,0x6f,
18 0xBf,0x86,0xDb,0xCf,0xE6, 0xEd,0xEd,0x87,0xFf,0xEf};
19
20 void init();
21 /*****************复位*************************/
22
23
24 void delay_ms(uint z)//毫秒级的延迟
*** ERROR C141 IN LINE 24 OF .\SUCESS\CESHI.C: syntax error near ';'
25 {
26 1 uint x,y;
*** ERROR C202 IN LINE 26 OF .\SUCESS\CESHI.C: 'x': undefined identifier
27 1 for(x=z;x>0;x--)
*** ERROR C202 IN LINE 27 OF .\SUCESS\CESHI.C: 'x': undefined identifier
28 1 for(y=110;y>0;y--);
*** ERROR C202 IN LINE 28 OF .\SUCESS\CESHI.C: 'y': undefined identifier
29 1 }
30
31 void delay_us()//延时微秒
32 {
33 1 _nop_();
34 1 }
35
36 void dq_reset()
37 {
38 1 uchar t;
39 1 uchar dd;
40 1 dq=0;
41 1 for(t=250;t>0;t--);
42 1 dq=1;
43 1 delay_us();delay_us();
44 1 dd=dq;
45 1 for(t=150;t>0;t--);
46 1 }
47
48 /******************读位写位**********************/
49
50 uchar read_bit()
51 {
C51 COMPILER V6.12 CESHI 04/29/2009 11:44:37 PAGE 2
52 1 uchar t;
53 1 uchar dd;
54 1
55 1 dq=0;
56 1 delay_us();delay_us();
57 1 dq=1;
58 1 for(t=3;t>0;t--);
59 1 dd=dq;//get the signal
60 1 for(t=20;t>0;t--);
61 1 return dd;
62 1 }
63
64 void write_bit(uchar dd)
65 {
66 1 uchar t;
67 1
68 1 if(dd==1)
69 1 {
70 2 dq=0;
71 2 delay_us();
72 2 dq=1;
73 2 for(t=30;t>0;t--);
74 2 }
75 1 else
76 1 {
77 2 dq=0;
78 2 for(t=30;t>0;t--);
79 2 dq=1;
80 2 delay_us();
81 2 delay_us();
82 2 }
83 1 }
84
85 void write_cmd(uchar z)//写命令
86 {
87 1 uchar i,t;
88 1 uchar temp;
89 1 uchar cmd=z;
90 1
91 1 for(i=0;i<8;i++)
92 1 {
93 2 temp=cmd&0x01;
94 2 if(temp)
95 2 {
96 3 dq=0;
97 3 delay_us();delay_us();//
98 3 dq=1;
99 3 for(t=40;t>0;t--);
100 3 }
101 2 else
102 2 {
103 3 dq=0;
104 3 for(t=40;t>0;t--);
105 3 dq=1;
106 3 delay_us(); delay_us();
107 3 }
108 2 cmd=_cror_(cmd,1);
109 2 }
110 1
111 1 }
112
113 /*****************温度******************************/
C51 COMPILER V6.12 CESHI 04/29/2009 11:44:37 PAGE 3
114
115 uchar read_byte()//读字节
116 {
117 1 uchar i;
118 1 uchar temp;
119 1 uchar dd;
120 1
121 1 temp=0x00;
122 1 for(i=0;i<8;i++)
123 1 {
124 2 temp=_cror_(temp,1);
125 2 dd=read_bit();
126 2 if(dd==1)
127 2 {
128 3 temp=temp|0x80;
129 3 }
130 2 else
131 2 {
132 3 temp=temp|0x00;
133 3 }
134 2 }
135 1 return(temp);
136 1 }
137
138 uint get_temper()//get centigrad for the ram
139 {
140 1
141 1 uchar LSB_temper;
142 1 uchar MSB_temper;
143 1 //uchar i;
144 1 uint c_temper=0;
*** ERROR C202 IN LINE 144 OF .\SUCESS\CESHI.C: 'c_temper': undefined identifier
145 1 float f_temper=0;
*** ERROR C141 IN LINE 145 OF .\SUCESS\CESHI.C: syntax error near 'float'
*** ERROR C202 IN LINE 145 OF .\SUCESS\CESHI.C: 'f_temper': undefined identifier
146 1
147 1 dq_reset();
148 1 write_cmd(0xcc);
149 1 //write_cmd(0x55);
150 1 /*if(z==1)
151 1 {
152 1 for(i=0;i<8;i++)
153 1 {
154 1 write_date(code1[i]);
155 1 }
156 1 }
157 1 else
158 1 {
159 1 for(i=0;i<8;i++)
160 1 {
161 1 write_date(code2[i]);
162 1 }
163 1 }*/
164 1 write_cmd(0xbe);//读存储器内的温度
165 1
166 1 LSB_temper=read_byte();
167 1 MSB_temper=read_byte();
168 1
169 1 c_temper=MSB_temper;
*** ERROR C202 IN LINE 169 OF .\SUCESS\CESHI.C: 'c_temper': undefined identifier
170 1 c_temper=(c_temper<<8);
*** ERROR C202 IN LINE 170 OF .\SUCESS\CESHI.C: 'c_temper': undefined identifier
C51 COMPILER V6.12 CESHI 04/29/2009 11:44:37 PAGE 4
171 1 c_temper=c_temper|LSB_temper;
*** ERROR C202 IN LINE 171 OF .\SUCESS\CESHI.C: 'c_temper': undefined identifier
172 1 f_temper=c_temper*0.0625;
*** ERROR C202 IN LINE 172 OF .\SUCESS\CESHI.C: 'f_temper': undefined identifier
173 1 c_temper=f_temper*10+0.5;
*** ERROR C202 IN LINE 173 OF .\SUCESS\CESHI.C: 'c_temper': undefined identifier
174 1
175 1 return (c_temper);
*** ERROR C202 IN LINE 175 OF .\SUCESS\CESHI.C: 'c_temper': undefined identifier
176 1 }
177
178 /******************温度显示***********************/
179
180 void display_temper(uint wengdu,uchar fc)//显示当前温度值
*** ERROR C141 IN LINE 180 OF .\SUCESS\CESHI.C: syntax error near ';'
181 {
182 1 uchar xx,yy,zz;
183 1 uint temp;
*** ERROR C202 IN LINE 183 OF .\SUCESS\CESHI.C: 'temp': undefined identifier
184 1
185 1 temp=wengdu;
*** ERROR C202 IN LINE 185 OF .\SUCESS\CESHI.C: 'temp': undefined identifier
186 1 xx=temp/100;
*** ERROR C202 IN LINE 186 OF .\SUCESS\CESHI.C: 'temp': undefined identifier
187 1 yy=temp%100/10;
*** ERROR C202 IN LINE 187 OF .\SUCESS\CESHI.C: 'temp': undefined identifier
188 1 zz=temp%10;
*** ERROR C202 IN LINE 188 OF .\SUCESS\CESHI.C: 'temp': undefined identifier
189 1
190 1 wela=1;
191 1 P0=0xfe;
192 1 wela=0;
193 1
194 1 P0=0x00;
195 1 dula=1;
196 1 P0=table[xx];
197 1 dula=0;
198 1 delay_ms(2);
*** ERROR C267 IN LINE 198 OF .\SUCESS\CESHI.C: 'delay_ms': requires ANSI-style prototype
199 1
200 1 P0=0xff;
201 1 wela=1;
202 1 P0=0xfd;
203 1 wela=0;
204 1
205 1 P0=0x00;
206 1 dula=1;
207 1 P0=(table[yy]+0x80);
208 1 dula=0;
209 1 delay_ms(2);
210 1
211 1 P0=0xff;
212 1 wela=1;
213 1 P0=0xfb;
214 1 wela=0;
215 1
216 1 P0=0x00;
217 1 dula=1;
218 1 P0=table[zz];
219 1 dula=0;
220 1 delay_ms(1);
221 1
C51 COMPILER V6.12 CESHI 04/29/2009 11:44:37 PAGE 5
222 1 P0=0xff;
223 1 wela=1;
224 1 P0=0xdf;
225 1 wela=0;
226 1
227 1 P0=0x00;
228 1 dula=1;
229 1 P0=table[fc];
*** ERROR C202 IN LINE 229 OF .\SUCESS\CESHI.C: 'fc': undefined identifier
230 1 dula=0;
231 1 delay_ms(1);
232 1 }
233
234
235
236 void init()//初始化
237 {
238 1 L_temper=100;
239 1 H_temper=320;
240 1
241 1 c1_temper=200;
242 1 dula=0;
243 1 wela=0;
244 1 }
245
246 void main()
247 {
248 1 init();
249 1 uint i;
*** ERROR C141 IN LINE 249 OF .\SUCESS\CESHI.C: syntax error near 'unsigned'
*** ERROR C202 IN LINE 249 OF .\SUCESS\CESHI.C: 'i': undefined identifier
250 1 while(1)
251 1 {
252 2 dq_reset();
253 2 write_cmd(0xcc);
254 2 write_cmd(0x44);
255 2 c1_temper=get_temper();
256 2 for(i=10;i>0;i--)
*** ERROR C202 IN LINE 256 OF .\SUCESS\CESHI.C: 'i': undefined identifier
257 2 {
258 3 display_temper(get_temper(),1);
259 3 }
260 2 }
261 1 }
262
C51 COMPILATION COMPLETE. 0 WARNING(S), 24 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -