⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 event.lst

📁 指纹识别源代码,用于智能门紧,还有配合MF800卡使用
💻 LST
📖 第 1 页 / 共 4 页
字号:
C51 COMPILER V7.01  EVENT                                                                  03/08/2007 12:09:37 PAGE 1   


C51 COMPILER V7.01, COMPILATION OF MODULE EVENT
OBJECT MODULE PLACED IN event.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE event.c OPTIMIZE(7,SPEED) REGFILE(.\fingerPRJ.ORC) BROWSE FLOATFUZZY(0) NOA
                    -REGS DEBUG OBJECTEXTEND CODE

stmt level    source

   1          #include "reg58.h"
   2          #include "intrins.h"
   3          
   4          #define _EVENT_C_
   5          #include "event.h"
   6          
   7          #include "system.h"
   8          #include "clock.h"
   9          #include "finger.h"
  10          #include "sram.h"
  11          #include "define.h"
  12          #include "timer.h"
  13          #include "lcd.h"
  14          #include "setup.h"
  15          #include "inout.h"
  16          #include "373.h"
  17          #include "keypad.h"
  18          
  19          
  20          /////////////////////////////////////////////////////////////////////////////////////////////
  21          /////////////////////////////////////////////////////////////////////////////////////////////
  22          /////////////////////////////////////////////////////////////////////////////////////////////
  23          /////////////////////////////////////////////////////////////////////////////////////////////
  24          unsigned char data eventtype;
  25          /////////////////////////////////////////////////////////////////////////////////////////////
  26          
  27          unsigned char code tblevent[]={LMACCESSGRANTED,LMACCESSDENIED,LMPASSWORDERR,LMFINGERERR,LMTSERROR,LMANTIPA
             -SSBACK,LMDOORERR};
  28          /////////////////////////////////////////////////////////////////////////////////////////////
  29          void accessevent(unsigned char message)
  30          {
  31   1              //struct eventdata  idata*  pevent;
  32   1      
  33   1              //if(duressflag)message+=0x80;
  34   1              if(message<EVENTINPUT)
  35   1              {
  36   2                      if(duressflag)message+=0x80;
  37   2              }
  38   1      
  39   1              getdatetime();
  40   1      
  41   1              tempbuff[0]=datetime[0];
  42   1              tempbuff[1]=datetime[1];
  43   1              tempbuff[2]=datetime[2];
  44   1              tempbuff[3]=datetime[3];
  45   1              tempbuff[4]=datetime[4];
  46   1              tempbuff[5]=datetime[5];
  47   1              tempbuff[6]=datetime[6];
  48   1              tempbuff[7]=datetime[7];
  49   1              tempbuff[8]=userid[0];
  50   1              tempbuff[9]=userid[1];
  51   1              tempbuff[10]=userid[2];
  52   1              tempbuff[11]=userid[3];
  53   1              tempbuff[12]=message;
C51 COMPILER V7.01  EVENT                                                                  03/08/2007 12:09:37 PAGE 2   

  54   1              //tempbuff[13]=0xff;
  55   1              tempbuff[13]=readFunctions();
  56   1              tempbuff[14]=0xff;
  57   1              tempbuff[15]=0xff;
  58   1      
  59   1              //rappendrecord();
  60   1      
  61   1              if((message&0x7f)>=EVENTINPUT)
  62   1              {
  63   2                      tempbuff[8]=0xff;
  64   2                      tempbuff[9]=0xff;
  65   2                      tempbuff[10]=0xff;
  66   2                      tempbuff[11]=0xff;
  67   2              }
  68   1      
  69   1              appendevent();
  70   1              
  71   1              if((message&0x7f)<EVENTINPUT)
  72   1              {
  73   2                      displaymessage(LMBLANK,LINE1);
  74   2                      displaymessage(tblevent[message&0xf],LINE2);
  75   2                      //delayTimerh(T500MS);
  76   2                      delayTimerh(TMSGWAITTIME);
  77   2                      //displaymessage(LMMAIN,LINE1);
  78   2                      displayMain();
  79   2                      displaytime();
  80   2                      
  81   2              }
  82   1              if((duressflag)&&((message&0X7F)<EVENTINPUT))
  83   1              {
  84   2                      duressflag=0;
  85   2                      if(!(message&0x1f))message=OUTPUTDURESS;
  86   2              }
  87   1      
  88   1              else
  89   1              {
  90   2                      switch(message)
  91   2                      {
  92   3                      case EVENTKEYPAD|MESSAGEGRANTED:message=OUTPUTR1IDOK;break;
  93   3                      case EVENTKEYPAD|MESSAGEDENIED:
  94   3                      case EVENTKEYPAD|MESSAGEPASSWORDERR:
  95   3                      case EVENTKEYPAD|MESSAGEFINGERERR:message=OUTPUTR1IDERR;break;
  96   3                      case EVENTKEYPAD|MESSAGETSERR:message=OUTPUTR1TSERR;break;
  97   3                      case EVENTKEYPAD|MESSAGEAPBERR:message=OUTPUTR1APBERR;break;
  98   3      
  99   3      
 100   3                      case EVENTREADER1|MESSAGEGRANTED:message=OUTPUTR1IDOK;break;
 101   3                      case EVENTREADER1|MESSAGEDENIED:
 102   3                      case EVENTREADER1|MESSAGEPASSWORDERR:
 103   3                      case EVENTREADER1|MESSAGEFINGERERR:message=OUTPUTR1IDERR;break;
 104   3                      case EVENTREADER1|MESSAGETSERR:message=OUTPUTR1TSERR;break;
 105   3                      case EVENTREADER1|MESSAGEAPBERR:message=OUTPUTR1APBERR;break;
 106   3      
 107   3      
 108   3                      case EVENTREADER2|MESSAGEGRANTED:message=OUTPUTR2IDOK;break;
 109   3                      case EVENTREADER2|MESSAGEDENIED:
 110   3                      case EVENTREADER2|MESSAGEPASSWORDERR:
 111   3                      case EVENTREADER2|MESSAGEFINGERERR:message=OUTPUTR2IDERR;break;
 112   3                      case EVENTREADER2|MESSAGETSERR:message=OUTPUTR2TSERR;break;
 113   3                      case EVENTREADER2|MESSAGEAPBERR:message=OUTPUTR2APBERR;break;
 114   3      
 115   3      
C51 COMPILER V7.01  EVENT                                                                  03/08/2007 12:09:37 PAGE 3   

 116   3                      case EVENTINPUT|MESSAGEEXIT:message=OUTPUTEXIT;break;
 117   3                      case EVENTINPUT|MESSAGECONTACT:message=OUTPUTCONTACT;break;
 118   3                      case EVENTINPUT|MESSAGEAUX1:message=OUTPUTAUX1;break;
 119   3                      case EVENTINPUT|MESSAGEAUX2:message=OUTPUTAUX2;break;
 120   3                      case EVENTINPUT|MESSAGETAMPER:message=OUTPUTTAMPER;break;
 121   3                      default:message=0xff;break;
 122   3                      }
 123   2              }
 124   1              //duressflag=0;
 125   1              if(message<=OUTPUTINOUT)
 126   1              {
 127   2                      getiodata(message);
 128   2                      if(!(doorunlockflag&&doorontimer>=ALWAYSON))
 129   2                      {
 130   3                              if(tempbuff[0])
 131   3                              {
 132   4                                      doorontimer=tempbuff[0];
 133   4                                      doorunlockflag=1;
 134   4                              }
 135   3                      }
 136   2                      if(!(alarmonflag&&alarmontimer>=ALWAYSON))
 137   2                      {
 138   3                              if(tempbuff[1])
 139   3                              {
 140   4                                      alarmontimer=tempbuff[1];
 141   4                                      alarmonflag=1;
 142   4                              }
 143   3                      }
 144   2                      if(!(ttl1onflag&&ttl1ontimer>=ALWAYSON))
 145   2                      {
 146   3                              if(tempbuff[2])
 147   3                              {
 148   4                                      ttl1ontimer=tempbuff[2];
 149   4                                      ttl1onflag=1;
 150   4                              }
 151   3                      }
 152   2                      if(!(ttl2onflag&&ttl2ontimer>=ALWAYSON))
 153   2                      {
 154   3                              if(tempbuff[3])
 155   3                              {
 156   4                                      ttl2ontimer=tempbuff[3];
 157   4                                      ttl2onflag=1;
 158   4                              }
 159   3                      }
 160   2                      if(!(beeponflag&&beepontimer>=ALWAYSON))
 161   2                      {
 162   3                              if(tempbuff[4])
 163   3                              {
 164   4                                      beepontimer=tempbuff[4];
 165   4                                      beeponflag=1;
 166   4                              }
 167   3                      }
 168   2              }
 169   1      
 170   1      
 171   1      }
 172          
 173          ///////////////////////////////////////////////////////////////////////
 174          void readevent(unsigned short itemcount)
 175          {
 176   1              itemcount+=PAGEEVENTSTART*16;
 177   1              ram_read16(itemcount,itemcount>>8);
C51 COMPILER V7.01  EVENT                                                                  03/08/2007 12:09:37 PAGE 4   

 178   1      }
 179          ///////////////////////////////////////////////////////////////////////
 180          /*void writeevent(unsigned short itemcount)
 181          {
 182                  itemcount+=PAGEEVENTSTART*16;
 183                  ram_write16(itemcount,itemcount>>8);
 184          }*/
 185          ///////////////////////////////////////////////////////////////////////
 186          void appendevent()
 187          {
 188   1              unsigned short eventwrite,eventread;
 189   1      
 190   1              eventwrite=readeventstop();
 191   1              ram_write16(eventwrite+PAGEEVENTSTART*16,(eventwrite+(PAGEEVENTSTART*16))>>8);
 192   1      
 193   1              eventwrite++;
 194   1              if(eventwrite>=MAXEVENTNUM)eventwrite=0;
 195   1              
 196   1              eventread=readeventstart();
 197   1              //if(eventread==eventwrite)return FALSE;
 198   1              if(eventread==eventwrite)
 199   1              {
 200   2                      eventread++;
 201   2                      if(eventread>=MAXEVENTNUM)eventread=0;
 202   2              }
 203   1      
 204   1              ram_writep0(EVENTSTART,eventread);
 205   1              ram_writep0(EVENTSTART+1,eventread>>8);
 206   1      
 207   1              ram_writep0(EVENTSTOP,eventwrite);
 208   1              ram_writep0(EVENTSTOP+1,eventwrite>>8);
 209   1              //ram_write16(eventwrite,eventwrite>>8,(unsigned char idata * )pevent);
 210   1      
 211   1              //return TRUE;
 212   1      }
 213          /////////////////////////////////////////////////////////////////////////
 214          unsigned short getneweventnum()
 215          {
 216   1              unsigned short eventwrite,eventread;
 217   1              eventwrite=sramgetshort(EVENTSTOP);
 218   1              eventread=sramgetshort(EVENTSTART);
 219   1      
 220   1              if(eventwrite<eventread)eventwrite+=MAXEVENTNUM;
 221   1              return eventwrite-eventread;
 222   1      }
 223          /////////////////////////////////////////////////////////////////////////
 224          /*bit getevent()
 225          {
 226                  unsigned short recordstart;
 227                  recordstart=sramgetshort(EVENTSTART);
 228                  if(recordstart==sramgetshort(EVENTSTOP))return FALSE;
 229                  //ram_read16(recordstart,recordstart>>8);
 230                  readevent(recordstart);
 231                  return TRUE;
 232          }*/
 233          /////////////////////////////////////////////////////////////////////////
 234          bit removeoneevent()
 235          {
 236   1              unsigned short eventwrite,eventread;
 237   1      
 238   1              eventread=readeventstart();
 239   1              eventwrite=readeventstop();
C51 COMPILER V7.01  EVENT                                                                  03/08/2007 12:09:37 PAGE 5   

 240   1              if(eventread==eventwrite)return FALSE;
 241   1      
 242   1              eventread++;
 243   1              if(eventread>=MAXEVENTNUM)eventread=0;
 244   1      
 245   1      
 246   1              ram_writep0(EVENTSTART,eventread);
 247   1              ram_writep0(EVENTSTART+1,eventread>>8);
 248   1              return TRUE;
 249   1      }
 250          /////////////////////////////////////////////////////////////////////////
 251          void clearevent()
 252          {
 253   1              ram_writep0(EVENTSTART,0);
 254   1              ram_writep0(EVENTSTART+1,0);
 255   1              ram_writep0(EVENTSTOP,0);
 256   1              ram_writep0(EVENTSTOP+1,0);
 257   1      
 258   1      }
 259          /////////////////////////////////////////////////////////////////////////
 260          bit getnewevent()
 261          {
 262   1              unsigned short eventstart,eventstop;
 263   1      
 264   1              eventstart=readeventstart();
 265   1              eventstop=readeventstop();
 266   1      
 267   1              if(eventstart==eventstop)return FALSE;
 268   1      
 269   1              readevent(eventstart);
 270   1      
 271   1              return TRUE;
 272   1      }
 273          /////////////////////////////////////////////////////////////////////////
 274          void accessok()
 275          {
 276   1              unsigned short eventcount,eventstop;
 277   1      

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -