📄 pccomm.lst
字号:
C51 COMPILER V7.01 PCCOMM 03/08/2007 12:09:39 PAGE 1
C51 COMPILER V7.01, COMPILATION OF MODULE PCCOMM
OBJECT MODULE PLACED IN pccomm.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE pccomm.c OPTIMIZE(7,SPEED) REGFILE(.\fingerPRJ.ORC) BROWSE FLOATFUZZY(0) NO
-AREGS DEBUG OBJECTEXTEND CODE
stmt level source
1 #include "reg58.h"
2 #include "intrins.h"
3
4 #define _PCCOMM_C_
5 #include "pccomm.h"
6
7 #include "event.h"
8 #include "rxd.h"
9 #include "system.h"
10 #include "sram.h"
11 #include "pcrxd.h"
12 #include "define.h"
13 #include "finger.h"
14 #include "clock.h"
15 #include "lcd.h"
16 #include "timer.h"
17 #include "keypad.h"
18 #include "user.h"
19 #include "setup.h"
20 #include "inout.h"
21 #include "373.h"
22 #include "ts.h"
23 ///////////////////////////////////////////////////////////
24 bit removeuserflag,removeeventflag;
25 unsigned char data getpcoktimer;
26 ///////////////////////////////////////////////////////////
27 /*bit getpcok()
28 {
29 unsigned char temptime;
30 temptime=timerh;
31 while((timerh-temptime)<TWAITPCOKTIME)
32 {
33 if(rxd0packflag)
34 {
35 return TRUE;
36 }
37 }
38 return FALSE;
39
40 }*/
41 ///////////////////////////////////////////////////////////
42 void pcgetstate()
43 {
44 1 //idata2idata(datetime,uart0buff+PCPACKAGEPARAMP,8);
45 1 idata2uart0(datetime,PCPACKAGEPARAMP,8);
46 1 uart0buff[PCPACKAGEPARAMP+8]=readsecumode();
47 1 uart0buff[PCPACKAGEPARAMP+9]=readbaudrate();
48 1 uart0buff[PCPACKAGEPARAMP+10]=readpinkeyin();
49 1 uart0buff[PCPACKAGEPARAMP+11]=readapbmode();
50 1 uart0buff[PCPACKAGEPARAMP+12]=VERHIGH;
51 1 uart0buff[PCPACKAGEPARAMP+13]=VERLOW;
52 1 ackpccmd(PCAGETSTATE,RETOK,14);
53 1 }
54 ///////////////////////////////////////////////////////////
C51 COMPILER V7.01 PCCOMM 03/08/2007 12:09:39 PAGE 2
55 void fpdatapc2fim()
56 {
57 1 unsigned short i;
58 1 unsigned char UART0DATA * pchar;
59 1
60 1 pchar=uart0buff+499;
61 1 for(i=0;i<480;i++)
62 1 {
63 2 *(pchar+24)=*pchar;
64 2 pchar--;
65 2 }
66 1 }
67 ///////////////////////////////////////////////////////////
68 //add a new user with finger print
69 void pcsetnewuser()
70 {
71 1 if(uart0buff[PCPACKAGEPARAMP+7]&0XF) //has fp data
72 1 {
73 2 uart02idata(PCPACKAGEPARAMP,tempbuff,8);
74 2 if(getuserbytempid())
75 2 {
76 3 //ackpccmd(PCASETNEWUSER,RETUSEREXIST,0); ;050827
77 3 //return; ;050827
78 3
79 3 deleteuserbysn();
80 3 if(tempbuff[15]&0xf)
81 3 {
82 4 uart02idata(PCPACKAGEPARAMP,tempbuff,8);
83 4 rdeleteuserbysn();
84 4 }
85 3 else
86 3 {
87 4 uart02idata(PCPACKAGEPARAMP,tempbuff,8);
88 4 }
89 3 }
90 2
91 2 if(adduser())
92 2 {
93 3 //HERE COPY FP DATA TO THE POSITION
94 3 fpdatapc2fim();
95 3 if(radduser(ADDUSERWITHFINGER))ackpccmd(PCASETNEWUSER,RETOK,0);
96 3 else
97 3 {
98 4 deleteuserbysn();
99 4 ackpccmd(PCASETNEWUSER,RETUSERFULL,0);
100 4 }
101 3 }
102 2 else
103 2 {
104 3 ackpccmd(PCASETNEWUSER,RETUSERFULL,0);
105 3 }
106 2 }
107 1 else //no fpdata
108 1 {
109 2
110 2 //idata2idata(uart0buff+PCPACKAGEPARAMP,tempbuff,8);
111 2 uart02idata(PCPACKAGEPARAMP,tempbuff,8);
112 2 if(getuserbytempid())
113 2 {
114 3 //ackpccmd(PCASETNEWUSER,RETUSEREXIST,0);
115 3 //return;
116 3 //deleteuserbysn();
C51 COMPILER V7.01 PCCOMM 03/08/2007 12:09:39 PAGE 3
117 3 ///uart02idata(PCPACKAGEPARAMP,tempbuff,8);
118 3 //rdeleteuserbysn();
119 3 deleteuserbysn();
120 3 if(tempbuff[15]&0xf)
121 3 {
122 4 uart02idata(PCPACKAGEPARAMP,tempbuff,8);
123 4 rdeleteuserbysn();
124 4 }
125 3 else
126 3 {
127 4 uart02idata(PCPACKAGEPARAMP,tempbuff,8);
128 4 }
129 3 }
130 2
131 2 if(adduser())
132 2 {
133 3 ackpccmd(PCASETNEWUSER,RETOK,0);
134 3 }
135 2 else
136 2 {
137 3 ackpccmd(PCASETNEWUSER,RETUSERFULL,0);
138 3 }
139 2 }
140 1 }
141 //////////////////////////////////////////////////////////////
142 void fpfim2pc()
143 {
144 1 unsigned short i;
145 1 unsigned char UART0DATA* pchar;
146 1
147 1 pchar=uart0buff+45;
148 1 for(i=0;i<480;i++)
149 1 {
150 2 *(pchar-25)=*pchar;
151 2 pchar++;
152 2 }
153 1 }
154 //////////////////////////////////////////////////////////////
155 void pcgetalluser()
156 {
157 1 unsigned short allusersn,i;
158 1
159 1 allusersn=uart0buff[PCPACKAGEPARAMP]|(uart0buff[PCPACKAGEPARAMP+1]<<8);
160 1
161 1 allusersn++;
162 1
163 1 currentsn=0xffff;
164 1 for(i=0;i<allusersn;i++)
165 1 {
166 2 if(!getusedsn(DOWNWARD))return;
167 2 }
168 1
169 1 tempbuff[14]=tempbuff[14]&0xf;
170 1 if(tempbuff[15]&0xf)
171 1 {
172 2 if(rgetuserbysn(GETUSERWITHFINGER))
173 2 {
174 3 fpfim2pc();
175 3 idata2uart0(tempbuff+8,PCPACKAGEPARAMP,8);
176 3 ackpccmd(PCAGETALLUSER,RETOK,488);
177 3 }
178 2 else
C51 COMPILER V7.01 PCCOMM 03/08/2007 12:09:39 PAGE 4
179 2 {
180 3 idata2uart0(tempbuff+8,PCPACKAGEPARAMP,8);
181 3 ackpccmd(PCAGETALLUSER,RETOK,8);
182 3 }
183 2 }
184 1 else
185 1 {
186 2 idata2uart0(tempbuff+8,PCPACKAGEPARAMP,8);
187 2 ackpccmd(PCAGETALLUSER,RETOK,8);
188 2 }
189 1 }
190 //////////////////////////////////////////////////////////////
191 //get a new user
192 void pcgetnewuser()
193 {
194 1 if(getnewuser())
195 1 {
196 2 tempbuff[14]=tempbuff[14]&0xf;
197 2 if(tempbuff[15]&0xf)
198 2 {
199 3 if(rgetuserbysn(GETUSERWITHFINGER))
200 3 {
201 4 fpfim2pc();
202 4 idata2uart0(tempbuff+8,PCPACKAGEPARAMP,8);
203 4 ackpccmd(PCAGETNEWUSER,RETOK,488);
204 4 }
205 3 else
206 3 {
207 4 idata2uart0(tempbuff+8,PCPACKAGEPARAMP,8);
208 4 ackpccmd(PCAGETNEWUSER,RETUSER,8);
209 4 }
210 3 }
211 2 else
212 2 {
213 3 idata2uart0(tempbuff+8,PCPACKAGEPARAMP,8);
214 3 ackpccmd(PCAGETNEWUSER,RETUSER,8);
215 3 }
216 2 //idata2idata(tempbuff+8,uart0buff+PCPACKAGEPARAMP,8);
217 2 removeuserflag=1;
218 2 getpcoktimer=timerh;
219 2 }
220 1 else
221 1 {
222 2 ackpccmd(PCAGETNEWUSER,RETNOUSER,0);
223 2 }
224 1
225 1 }
226 //////////////////////////////////////////////////////////////
227 //get the specified user
228 void pcgetuser()
229 {
230 1 //idata2idata(uart0buff+PCPACKAGEPARAMP,tempbuff,4);
231 1 uart02idata(PCPACKAGEPARAMP,tempbuff,4);
232 1 if(getuserbytempid())
233 1 {
234 2 tempbuff[14]=tempbuff[14]&0xf;
235 2 if(tempbuff[15]&0xf)
236 2 {
237 3 if(rgetuserbysn(GETUSERWITHFINGER))
238 3 {
239 4 fpfim2pc();
240 4 idata2uart0(tempbuff+8,PCPACKAGEPARAMP,8);
C51 COMPILER V7.01 PCCOMM 03/08/2007 12:09:39 PAGE 5
241 4 ackpccmd(PCAGETUSER,RETOK,488);
242 4 }
243 3 else
244 3 {
245 4 idata2uart0(tempbuff+8,PCPACKAGEPARAMP,8);
246 4 ackpccmd(PCAGETUSER,RETOK,8);
247 4 }
248 3 }
249 2 else
250 2 {
251 3 idata2uart0(tempbuff+8,PCPACKAGEPARAMP,8);
252 3 ackpccmd(PCAGETUSER,RETOK,8);
253 3 }
254 2
255 2 //idata2idata(tempbuff+8,uart0buff+PCPACKAGEPARAMP,8);
256 2 }
257 1 else
258 1 {
259 2 ackpccmd(PCAGETUSER,RETERR,0);
260 2 }
261 1 return;
262 1
263 1 /*if(rgetuser((uart1buff[PAFIMPARAM]+uart1buff[PAFIMPARAM+1]<<8),1))
264 1 {
265 1 //here send the user info back to pc
266 1 }
267 1 else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -