📄 main.lst
字号:
165 2 {
166 3 transTempDisplay(t,zz);
167 3 currentState = transTemp;
168 3 }
169 2 if (key == 0xff)
170 2 {
171 3 low_alarmDisplay(L);
172 3 currentState = low_alarm;
173 3 }
174 2 break;
175 2
176 2 case lowestTemp: //////////////
177 2 if (key ==S1)
178 2 {
C51 COMPILER V7.50 MAIN 09/05/2007 12:18:55 PAGE 4
179 3 highestTempDisplay(high1,high2);
180 3 currentState = highestTemp;
181 3
182 3 }
183 2
184 2 if(key==S0)
185 2 {
186 3 defaultDisplay(flag);
187 3 currentState = defaultState;
188 3 }
189 2
190 2 if(key == S2)
191 2 {
192 3 transTempDisplay(t,zz);
193 3 currentState = transTemp;
194 3 }
195 2 if (key == 0xff)
196 2 {
197 3 lowestTempDisplay(low1,low2);
198 3 currentState = lowestTemp;
199 3 }
200 2 break;
201 2
202 2 case highestTemp:
203 2 if(key==S0)
204 2 {
205 3 defaultDisplay(flag);
206 3 currentState = defaultState;
207 3 }
208 2 if (key == S1)
209 2 {
210 3 currentTempDisplay(t,zz);
211 3 currentState = currentTemp;
212 3
213 3 }
214 2 if(key == S2)
215 2 {
216 3 transTempDisplay(t,zz);
217 3 currentState = transTemp;
218 3 }
219 2 if (key == 0xff)
220 2 {
221 3 highestTempDisplay(high1,high2);
222 3 currentState = highestTemp;
223 3 }
224 2 break;
225 2
226 2 default:
227 2 break;
228 2 }
229 1 }
230
231 void main()
232 {
233 1 unsigned char *z;
234 1 unsigned char trdata[6],t2,rec[3];
235 1
236 1 unsigned char i,j,k;
237 1
238 1
239 1 init_serialcomm();
240 1
C51 COMPILER V7.50 MAIN 09/05/2007 12:18:55 PAGE 5
241 1
242 1 t=readtemp(z);
243 1 low1=high1=t;
244 1 low2=high2=*z;
245 1
246 1 j=0;
247 1 rec[0]=0x20;
248 1 rec[1]=0x00;
249 1
250 1 while(1)
251 1 {
252 2 t=readtemp(z);
253 2 zz=*z;
254 2
255 2
256 2 if(low1>t) {low1=t;low2=*z;} /////判断最高最低温度
257 2 if(low1==t)
258 2 {
259 3 if(low2>*z) {low1=t;low2=*z;}
260 3 }
261 2 if(high1<t) {high1=t;high2=*z;}
262 2 if(high1==t)
263 2 {
264 3 if(high2<*z) {high1=t;high2=*z;}
265 3 }
266 2
267 2
268 2
269 2 if(!H_KEY)
270 2 {
271 3 delay10ms(20);
272 3 key = read (READ);
273 3 statementmach(key);
274 3 }
275 2 else
276 2 {
277 3 key=0xff;
278 3 statementmach(key);
279 3 }
280 2
281 2 i=0;
282 2 t2=zz;
283 2 trdata[0]=0xff;
284 2 trdata[1]=t;
285 2 trdata[2]=t2;
286 2 trdata[3]=0x01;
287 2 trdata[4]=flag;
288 2 trdata[5]=0x00;
289 2
290 2 while(i<6){
291 3 SBUF=trdata[i];
292 3 while(TI==0);
293 3 TI=0;
294 3 i++;
295 3 }
296 2
297 2
298 2 if(RI==1){
299 3 rec[j%2]=SBUF;
300 3 RI=0;
301 3 j++;
302 3 }
C51 COMPILER V7.50 MAIN 09/05/2007 12:18:55 PAGE 6
303 2
304 2
305 2
306 2 H=rec[0];
307 2 L=rec[1];
308 2
309 2 if(t>=H|t<L) {p27=0;sent_byte(0x88);} //超过报警上下限时报警
310 2 else {p27=1;sent_byte(0xa4);}
311 2
312 2
313 2 if(p00==1) flag=0x01;
314 2 else flag=0x02;
315 2
316 2 }
317 1
318 1
319 1 }
*** WARNING C280 IN LINE 236 OF MAIN.C: 'k': unreferenced local variable
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1140 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 11 31
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 + -