📄 main.lst
字号:
C51 COMPILER V7.50 MAIN 05/17/2008 12:45:00 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: D:\Program Files\Keil\C51\BIN\C51.EXE main.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #define main_GLOBALS
2 #include "config.h"
3 #include "main.h"
4 #include "delay.h"
5 #include "zlg500s.h"
6 #include "zlg500S_comm.h"
7
8 static void main_init();
9 INT8U DataBfr[16];
10 INT8U Card_Snr[4];
11 INT8U TxMode;
12 INT8U Atq[2];
13 INT8U Sak;
14
15 main()
16 {
17 1 INT8U temp;
18 1
19 1 main_init();
20 1 GetDvcInfo(DataBfr);
21 1 DataBfr[0] = 0xff;
22 1 DataBfr[1] = 0xff;
23 1 DataBfr[2] = 0xff;
24 1 DataBfr[3] = 0xff;
25 1 DataBfr[4] = 0xff;
26 1 DataBfr[5] = 0xff;
27 1 PCDLoadKey(KEYA,0,DataBfr);
28 1
29 1 while(1)
30 1 {
31 2 if(PiccRequest(REQSTD,DataBfr) != OK) continue;
32 2 if(PiccAnticoll(SELCODE1,0,Card_Snr)!=OK) continue;
33 2 if(PiccSelect(SELCODE1,Card_Snr,DataBfr)!=OK) continue;
34 2 if(PiccAuthE2(KEYA,Card_Snr,0,4)!=OK) continue;
35 2 if(PiccRead(4,DataBfr)!=OK) continue;
36 2 DataBfr[0] = 0x10; DataBfr[4] = 0xef; DataBfr[8] = 0x10;
37 2 DataBfr[1] = 0x0; DataBfr[5] = 0xff; DataBfr[9] = 0x0;
38 2 DataBfr[2] = 0x0; DataBfr[6] = 0xff; DataBfr[10] = 0x0;
39 2 DataBfr[3] = 0x0; DataBfr[7] = 0xff; DataBfr[11] = 0x0;
40 2 DataBfr[12] = 0x04; DataBfr[13] = 0xfb; DataBfr[14] = 0x04; DataBfr[15] = 0xfb;
41 2 if(PiccWrite(4,DataBfr)!=OK) continue;
42 2 DataBfr[0] = 0x0;
43 2 if(PiccRead(4,DataBfr)!=OK) continue;
44 2 DataBfr[0] = 0x01;
45 2 DataBfr[1] = 0x0;
46 2 DataBfr[2] = 0x0;
47 2 DataBfr[3] = 0x0;
48 2 if(PiccValue(DECREMENT,4,DataBfr,5)!=OK) continue;
49 2 if(PiccValue(INCREMENT,4,DataBfr,6)!=OK) continue;
50 2 if(PiccRead(5,DataBfr)!=OK) continue;
51 2 if(PiccRead(6,DataBfr)!=OK) continue;
52 2 PiccHalt();
53 2
54 2 //测试卡自动检测----串口主动发送回数据,TX交替,E2密码验证,密钥A,读4块
55 2 DataBfr[0] = 0;
C51 COMPILER V7.50 MAIN 05/17/2008 12:45:00 PAGE 2
56 2 while(PiccAutoDetect(ADSERIALOUT | ADINTENABLE, ADTXALERT, REQSTD, 'E', KEYA, DataBfr, 4) != 0);
57 2 while(PiccADRcv(&TxMode,Atq,&Sak,Card_Snr,DataBfr) != 0);
58 2 DataBfr[0] = 0x10; DataBfr[4] = 0xef; DataBfr[8] = 0x10;
59 2 DataBfr[1] = 0x0; DataBfr[5] = 0xff; DataBfr[9] = 0x0;
60 2 DataBfr[2] = 0x0; DataBfr[6] = 0xff; DataBfr[10] = 0x0;
61 2 DataBfr[3] = 0x0; DataBfr[7] = 0xff; DataBfr[11] = 0x0;
62 2 DataBfr[12] = 0x04; DataBfr[13] = 0xfb; DataBfr[14] = 0x04; DataBfr[15] = 0xfb;
63 2 if(PiccWrite(4,DataBfr)!=OK) continue;
64 2 DataBfr[0] = 0x0;
65 2 if(PiccRead(4,DataBfr)!=OK) continue;
66 2 DataBfr[0] = 0x01;
67 2 DataBfr[1] = 0x0;
68 2 DataBfr[2] = 0x0;
69 2 DataBfr[3] = 0x0;
70 2 if(PiccValue(DECREMENT,4,DataBfr,5)!=OK) continue;
71 2 if(PiccValue(INCREMENT,4,DataBfr,6)!=OK) continue;
72 2 if(PiccRead(5,DataBfr)!=OK) continue;
73 2 if(PiccRead(6,DataBfr)!=OK) continue;
74 2 PiccHalt();
75 2
76 2 //测试卡自动检测----串口主动发送回数据,发回后继续检测,检测后将卡挂起,TX全发送,直接密码验证,密钥A,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -