📄 key.lst
字号:
245 1 if(!b_key_2second)return;
246 1 if(keybuff!=17)return;
247 1 if(keybuff==17)
248 1 {
249 2 Led_R=0;
250 2 while(!b_keyonoff) //等待按键放手
251 2 {scan_key();}
252 2 b_key_2second=0;keybuff=0xff;b_keyonoff=0;
253 2 while(1)
254 2 {
255 3 scan_key();
256 3 ifr_irn();
257 3 study_code();
258 3 if(b_key_2second)
259 3 {
260 4 Led_R=1;
261 4 while(!b_keyonoff)
262 4 {scan_key();}
263 4 b_key_2second=0;
264 4 keybuff=0xff;
265 4 b_keyonoff=0;
266 4 return;
267 4 }
268 3 }
269 2 }
270 1
271 1 }
272
273 //****************************************************
274 //function:keyexe1
275 //input :无
276 //output :无
277 //modify :2007-9-10
278 //****************************************************
279 void keyexe1(void)
280 {
281 1 if(!b_password)return;
282 1 if(!b_key_2second1)return;
283 1 if(keybuff!=18)return;
284 1 if(keybuff==18)
285 1 {
286 2 Led_R=0;
287 2 b_study=1;
288 2 while(!b_keyonoff) //等待按键放手
289 2 {scan_key();}
290 2 b_key_2second1=0;keybuff=0xff;b_keyonoff=0;
291 2 while(1)
292 2 {
293 3 scan_key();
294 3 ifr_irn();
295 3 ifr_administer();
296 3 if(b_keyonoff)
297 3 {
298 4 b_keyonoff=0;
299 4 if(keyID>=13)break;
300 4 b_send=1;
301 4 checkok(keyID);
302 4 }
303 3
C51 COMPILER V7.50 KEY 09/17/2007 09:47:23 PAGE 6
304 3 if(b_key_2second1)
305 3 {
306 4 Led_R=1;
307 4 b_study=0;
308 4 while(!b_keyonoff) //等待按键放手
309 4 {scan_key();}
310 4 b_key_2second1=0;cycle1=0;
311 4 keybuff=0xff;b_keyonoff=0;
312 4 return;
313 4
314 4 }
315 3
316 3 }
317 2 }
318 1
319 1 }
320
321 //****************************************************####################################################
322 //****************************************************####################################################
323 //****************************************************
324 //function:password_exit
325 //input :无
326 //output :无
327 //modify :2007-9-10
328 //****************************************************
329 void password_exit(void)
330 {
331 1
332 1 if(!b_password)return;
333 1 if(!b_key_2second2)return;
334 1 if(keybuff!=19)return;
335 1 b_err=0;
336 1 if(keyID==19)
337 1 {
338 2 Led_R=0;
339 2 cycle=0;
340 2 password_d();
341 2 while(!b_keyonoff) //等待按键放手
342 2 {scan_key();}
343 2 b_key_2second2=0;keybuff=0xff;b_keyonoff=0;
344 2 while(1)
345 2 {
346 3 scan_key();
347 3
348 3 if(b_keyonoff)
349 3 {
350 4 b_keyonoff=0;
351 4 if(keyID==16){if(cycle>=1){b_pwerror=1;password_d1();cycle--;}}
352 4 else
353 4 {
354 5 switch(cycle)
355 5 {
356 6 case 0:temp[0]=keyID<<4;if(keyID>9)b_err=1;break;
357 6 case 1:temp[0]=temp[0]+keyID;if(keyID>9)b_err=1;break;
358 6 case 2:temp[1]=keyID<<4;if(keyID>9)b_err=1;break;
359 6 case 3:temp[1]=temp[1]+keyID;if(keyID>9)b_err=1;break;
360 6 case 4:temp[2]=keyID<<4;if(keyID>9)b_err=1;break;
361 6 case 5:temp[2]=temp[2]+keyID;if(keyID>9)b_err=1;break;
362 6 case 6:if(keyID!=12){b_err=1;break;}
363 6 if((temp[0]==0x12)&&(temp[1]==0x34)&&(temp[2]==0x56))
364 6 {zhuti();Led_R=1;cycle=0;b_password=0;return;}
365 6 else
C51 COMPILER V7.50 KEY 09/17/2007 09:47:23 PAGE 7
366 6 {b_err=1;}break;
367 6 }
368 5 cycle++;
369 5 password_d1();
370 5 }
371 4
372 4 }
373 3 if(b_err)
374 3 {
375 4 b_err=0;
376 4 cycle=0;
377 4 b_pwerror1=1;
378 4 password_d1();
379 4 led_ray11(4);
380 4 }
381 3
382 3 }
383 2 }
384 1
385 1 }
386
387 //****************************************************
388 //function:key execute
389 //input :无
390 //output :无
391 //modify :2007-8-24
392 //****************************************************
393 void key_odd(void)
394 {
395 1
396 1 uchar iii=0;
397 1 if(keyID>=13)return;
398 1 if(!b_keyonoff)return;
399 1 b_keyonoff=0;
400 1
401 1 b_send=1;
402 1 checkok(keybuff);
403 1 if(iii)
404 1 {
405 2 tx2262(0xaa,0xaa,0xaa);
406 2 led_ray2(0);
407 2 }
408 1 }
409
410 //****************************************************
411 //function:key execute
412 //input :无
413 //output :无
414 //modify :2007-8-24
415 //****************************************************
416 void key_odd1(void)
417 {
418 1 if(keybuff!=19)return;
419 1 if(!b_key_5second)return;
420 1 if(b_password)return;
421 1 if(keybuff==19)
422 1 {
423 2 password_d();
424 2 while(!b_keyonoff) //等待按键放手
425 2 {scan_key();}
426 2 b_key_5second=0;keybuff=0xff;b_keyonoff=0;
427 2
C51 COMPILER V7.50 KEY 09/17/2007 09:47:23 PAGE 8
428 2 while(1)
429 2 {
430 3 scan_key();
431 3
432 3 if((b_keyonoff)&&(!b_password))
433 3 {
434 4 b_keyonoff=0;
435 4 if(keyID==16){if(cycle>=1){b_pwerror=1;password_d1();cycle--;}}
436 4 else
437 4 {
438 5 switch(cycle)
439 5 {
440 6 case 0:temp[0]=keyID<<4;if(keyID>9)b_err=1;break;
441 6 case 1:temp[0]=temp[0]+keyID;if(keyID>9)b_err=1;break;
442 6 case 2:temp[1]=keyID<<4;if(keyID>9)b_err=1;break;
443 6 case 3:temp[1]=temp[1]+keyID;if(keyID>9)b_err=1;break;
444 6 case 4:temp[2]=keyID<<4;if(keyID>9)b_err=1;break;
445 6 case 5:temp[2]=temp[2]+keyID;if(keyID>9)b_err=1;break;
446 6 case 6:if(keyID!=12){b_err=1;break;}
447 6 if((temp[0]==0x12)&&(temp[1]==0x34)&&(temp[2]==0x56))
448 6 {dele_zero();function_a();function_b();
449 7 Led_R=1;cycle=0;b_password=1;}
450 6 else
451 6 {b_err=1;}break;
452 6 }
453 5 cycle++;
454 5 if(!b_password)
455 5 password_d1();
456 5 }
457 4 }
458 3 if(b_err)
459 3 {
460 4 b_err=0;
461 4 cycle=0;
462 4 b_pwerror1=1;
463 4 password_d1();
464 4 led_ray1(4);
465 4 }
466 3 if((b_keyonoff)&&(b_password))
467 3 {
468 4 b_keyonoff=0;
469 4 if(keyID==2){function_c();}
470 4 else if(keyID==8){function_a();function_b();}
471 4 }
472 3 }
473 2 }
474 1 }
475
476 ////////////////////////////////////////////////////////////////
477 ////////// ****** ** ** ***** /////////////////////////
478 ////////// ** *** ** ** ** /////////////////////////
479 ////////// ****** ** * ** ** ** /////////////////////////
480 ////////// ** ** *** ** ** /////////////////////////
481 ////////// ****** ** ** ***** /////////////////////////
482 ////////////////////////////////////////////////////////////////
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1555 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
C51 COMPILER V7.50 KEY 09/17/2007 09:47:23 PAGE 9
DATA SIZE = 5 10
IDATA SIZE = ---- ----
BIT SIZE = 14 1
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -