📄 zuosi2.lst
字号:
C51 COMPILER V6.12 ZUOSI2 04/28/2009 20:16:04 PAGE 1
C51 COMPILER V6.12, COMPILATION OF MODULE ZUOSI2
OBJECT MODULE PLACED IN zuosi2.obj
COMPILER INVOKED BY: E:\Keil\C51\BIN\C51.EXE .\sucess\zuosi2.c DEBUG OBJECTEXTEND PRINT(.\zuosi2.lst) OBJECT(zuosi2.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,c2_temper;
14 float f1_temper,f2_temper;
15
16 uint L_temper;
17 uint H_temper;
18
19 uchar iccode[3][8];
20
21 uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66, 0x6d,0x7d,0x07,0x7f,0x6f,
22 0xBf,0x86,0xDb,0xCf,0xE6, 0xEd,0xEd,0x87,0xFf,0xEf};
23
24 void delay_ms(uint z);
25 void delay_us();
26 void dq_reset();
27 void write_cmd(uchar z);
28 uchar read_temper();
29 uint get_temper();
30 uchar write_bit();
31 uchar read_bit();
32 get_firstid();
33 get_seconedid();
34 uchar write_date(uchar z);
35 uchar read_date();
36 void convert();
37 void deal_temper();
38 void deal_ds1();
39 void deal_ds2();
40 void display_temper(uint wengdu,uchar fc);
41 void init1();
42 void init2();
43 void warn_temper();
44 /*******************delaytime********************/
45
46 void delay_ms(uint z)//毫秒级的延迟
47 {
48 1 uint x,y;
49 1 for(x=z;x>0;x--)
50 1 for(y=110;y>0;y--);
51 1 }
52
53 void delay_us()//延时微秒
54 {
C51 COMPILER V6.12 ZUOSI2 04/28/2009 20:16:04 PAGE 2
55 1 _nop_();
56 1 }
57 /********************dqreset**************************/
58
59 uchar dq_reset()//复位
60 {
*** ERROR C231 IN LINE 60 OF .\SUCESS\ZUOSI2.C: 'dq_reset': redefinition
61 1 uchar t;
62 1 uchar exist;
63 1
64 1 dq=0;
65 1 for(t=250;t>0;t--);
66 1 dq=1;
67 1 for(t=20;t>0;t--)
68 1 exist=dq;
69 1 for(t=100;t>0;t--);
70 1 return exist;
71 1 }
*** ERROR C231 IN LINE 71 OF .\SUCESS\ZUOSI2.C: 'dq_reset': redefinition
72
73 /***********************temper*********************/
74
75 uchar read_temper()//读温度
76 {
77 1
78 1 uchar t;
79 1 uchar i;
80 1 uchar temper;
81 1 uchar dd;
82 1
83 1 temper=0x00;
84 1 for(i=0;i<8;i++)
85 1 {
86 2 temper=_cror_(temper,1);
87 2
88 2 dd=read_bit();
89 2 if(dd==1)
90 2 {
91 3 temper=temper | 0x80;
92 3 }
93 2 else
94 2 {
95 3 temper=temper | 0x00;
96 3 }
97 2 }
98 1 return(temper);
99 1 }
100
101 uint get_temper()//get centigrad for the ram
102 {
103 1
104 1 uchar LSB_temper;
105 1 uchar MSB_temper;
106 1 uint c_temper=0;
107 1 float f_temper=0;
108 1
109 1 //dq_reset();
110 1
111 1 //write_cmd(0xcc);
112 1 write_cmd(0xbe);
113 1
114 1 LSB_temper=read_temper();
C51 COMPILER V6.12 ZUOSI2 04/28/2009 20:16:04 PAGE 3
115 1 MSB_temper=read_temper();
116 1
117 1 c_temper=MSB_temper;
118 1 c_temper=c_temper<<8;
119 1 c_temper=c_temper|LSB_temper;
120 1 f_temper=c_temper*0.0625;
121 1 c_temper=f_temper*10+0.5;
122 1
123 1 return c_temper;
124 1 }
125
126 void write_cmd(uchar z)//写命令
127 {
128 1 uchar t,i;
129 1 uchar temper;
130 1 uchar cmd=z;
131 1
132 1 for(i=0;i<8;i++)
133 1 {
134 2 temper=cmd&0x01;
135 2 if(temper)
136 2 {
137 3 write_bit(1);
*** ERROR C267 IN LINE 137 OF .\SUCESS\ZUOSI2.C: 'write_bit': requires ANSI-style prototype
138 3 }
139 2 else
140 2 {
141 3 write_bit(0);
142 3 }
143 2 cmd=_cror_(cmd,1);
144 2 }
145 1
146 1 }
147
148 /************************writeorreadbit********************************/
149
150 uchar read_bit()
151 {
152 1 bit dd;
153 1 uchar t;
154 1
155 1 dq=0;
156 1 delay_us();
157 1 dq=1;
158 1 for(t=2;t>0;t--);
159 1 dd=dq;//get the signal
160 1 for(t=20;t>0;t--);
161 1 return(dd);
162 1 }
163
164 void write_bit(uchar dd)
165 {
*** ERROR C231 IN LINE 165 OF .\SUCESS\ZUOSI2.C: 'write_bit': redefinition
166 1 uchar t;
167 1
168 1 if(dd=1)
169 1 {
170 2 dq=0;
171 2 delay_us();
172 2 dq=1;
173 2 for(t=30;t>0;t--);
174 2 }
C51 COMPILER V6.12 ZUOSI2 04/28/2009 20:16:04 PAGE 4
175 1 else
176 1 {
177 2 dq=0;
178 2 for(t=20;t>0;t--);
179 2 dq=1;
180 2 delay_us();
181 2 delay_us();
182 2 }
183 1 }
184
185 /*************************getid*************************/
186
187 void get_firstid()
188 {
*** ERROR C231 IN LINE 188 OF .\SUCESS\ZUOSI2.C: 'get_firstid': redefinition
189 1 uchar t;
190 1 uchar w=0;
191 1 bit d1,d2;
192 1
193 1 dq_reset();
194 1 write_cmd(0xf0);
195 1
196 1 for(t=0;t<64;t++)
197 1 {
198 2 d1=read_bit();
199 2 d2=read_bit();
200 2 if(t>0&&t%8==0) ++w;
201 2 iccode[1][w]=_cror_(iccode[1][w],1);
*** ERROR C213 IN LINE 201 OF .\SUCESS\ZUOSI2.C: left side of asn-op not an lvalue
202 2
203 2 if(d1==1&&dd2==0)
*** ERROR C202 IN LINE 203 OF .\SUCESS\ZUOSI2.C: 'dd2': undefined identifier
204 2 {
205 3 iccode[1][w]=(iccode[1][w])|0x80;
*** ERROR C213 IN LINE 205 OF .\SUCESS\ZUOSI2.C: left side of asn-op not an lvalue
206 3 write_bit(1);
207 3 }
208 2 else if(d1==0&&d2==1)
209 2 {
210 3 iccode[1][w]=(iccode[1][w])|0x00;
*** ERROR C213 IN LINE 210 OF .\SUCESS\ZUOSI2.C: left side of asn-op not an lvalue
211 3 write_bit(0);
212 3 }
213 2 else if(d1==0&&d2==0)
214 2 {
215 3 iccode[1][w]=(iccode[1][w])|0x00;
*** ERROR C213 IN LINE 215 OF .\SUCESS\ZUOSI2.C: left side of asn-op not an lvalue
216 3 write_bit(0);
217 3 }
218 2 }
219 1 }
*** ERROR C231 IN LINE 219 OF .\SUCESS\ZUOSI2.C: 'get_firstid': redefinition
220
221 void get_seconedid()
222 {
*** ERROR C231 IN LINE 222 OF .\SUCESS\ZUOSI2.C: 'get_seconedid': redefinition
223 1 uchar t;
224 1 uchar w=0;
225 1 bit d1,d2;
226 1
227 1 dq_reset();
228 1 write_cmd(0xf0);
C51 COMPILER V6.12 ZUOSI2 04/28/2009 20:16:04 PAGE 5
229 1
230 1 for(t=0;t<64;t++)
231 1 {
232 2 d1=read_bit();
233 2 d2=read_bit();
234 2 if(t>0&&t%8==0) ++w;
235 2 iccode[2][w]=_cror_(iccode[2][w],1);
*** ERROR C213 IN LINE 235 OF .\SUCESS\ZUOSI2.C: left side of asn-op not an lvalue
236 2
237 2 if(d1==1&&d2==0)
238 2 {
239 3 write_bit(1);
240 3 iccode[2][w]=(iccode[2][w])|0x80;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -