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

📄 scankey.lst

📁 用于GPRS远程电力抄表系统中采集器端的程序
💻 LST
字号:
C51 COMPILER V7.50   SCANKEY                                                               07/19/2006 10:05:16 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE SCANKEY
OBJECT MODULE PLACED IN scankey.OBJ
COMPILER INVOKED BY: D:\Program Files\Keil\C51\BIN\C51.EXE scankey.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include "io.h"
   2          #include "ioscan.h"
   3          #include "ioport.h"
   4          #include "i2c.h"
   5          #include "recframe.h"
   6          #include "process.h"
   7          
   8          void io_cmp(uchar io_num)
   9          {
  10   1              io_status[io]=1;        
  11   1              bak_status[io_num]=io_status[io_num];
  12   1      }
  13          
  14          void io_Scan1(void)
  15          {
  16   1              recode=(port2&0xF0)|0x0F;
  17   1              io_temp=(~sccode)+(~recode);
  18   1              if((io_temp&0x11)==0x11)    
  19   1              {
  20   2               io = 0x00;
  21   2               io_cmp(io);
  22   2              }
  23   1              else io_status[0]=0;              
  24   1              if((io_temp&0x21)==0x21)    
  25   1              {
  26   2                io = 0x01;
  27   2                io_cmp(io);
  28   2              }
  29   1              else io_status[1]=0; 
  30   1              if((io_temp&0x41)==0x41)       
  31   1              {
  32   2                      io = 0x02;
  33   2                      io_cmp(io);
  34   2              }
  35   1              else io_status[2]=0;    
  36   1              if((io_temp&0x81)==0x81)  
  37   1              {
  38   2                      io = 0x03;
  39   2                      io_cmp(io);
  40   2              }
  41   1              else io_status[3]=0; 
  42   1         
  43   1      }
  44          
  45          void io_Scan2(void)   
  46          {    
  47   1            recode=(port2&0xF0)|0x0F;
  48   1            io_temp=(~sccode)+(~recode);
  49   1            if((io_temp&0x12)==0x12)    
  50   1             {
  51   2               io = 0x04;
  52   2               io_cmp(io);
  53   2             }
  54   1            else io_status[4]=0;              
  55   1            if((io_temp&0x22)==0x22)    
C51 COMPILER V7.50   SCANKEY                                                               07/19/2006 10:05:16 PAGE 2   

  56   1             {
  57   2                io = 0x05;
  58   2                io_cmp(io);
  59   2             }
  60   1            else io_status[5]=0; 
  61   1            if((io_temp&0x42)==0x42)       
  62   1             {
  63   2                io = 0x06;
  64   2                io_cmp(io);
  65   2             }
  66   1            else io_status[6]=0;    
  67   1            if((io_temp&0x82)==0x82)  
  68   1             {
  69   2                io = 0x07;
  70   2               io_cmp(io);
  71   2             }
  72   1            else io_status[7]=0; 
  73   1        
  74   1      }
  75          
  76          void io_Scan3(void)   
  77          {      
  78   1            recode=(port2&0xF0)|0x0F;
  79   1            io_temp=(~sccode)+(~recode);
  80   1            if((io_temp&0x14)==0x14)   
  81   1             {
  82   2               io = 0x08;
  83   2               io_cmp(io);
  84   2             }
  85   1            else io_status[8]=0;  
  86   1            if((io_temp&0x24)==0x24)  
  87   1             {
  88   2               io = 0x09;
  89   2               io_cmp(io);
  90   2             }
  91   1            else io_status[9]=0;     
  92   1            if((io_temp&0x44)==0x44)                                                     
  93   1             {
  94   2                io = 0x0A;
  95   2                io_cmp(io);
  96   2             }
  97   1            else io_status[10]=0;      
  98   1            if((io_temp&0x84)==0x84)                                                     
  99   1             {
 100   2                io = 0x0B;
 101   2                io_cmp(io);
 102   2             }
 103   1            else io_status[11]=0; 
 104   1        
 105   1      }
 106          
 107          void io_Scan4(void)   
 108          {   
 109   1            recode=(port2&0xF0)|0x0F;    
 110   1            io_temp=(~sccode)+(~recode);              
 111   1            if((io_temp&0x18)==0x18)      
 112   1             {
 113   2                io = 0x0C;
 114   2                io_cmp(io);
 115   2             }
 116   1            else io_status[12]=0;
 117   1            if((io_temp&0x28)==0x28)  
C51 COMPILER V7.50   SCANKEY                                                               07/19/2006 10:05:16 PAGE 3   

 118   1             {
 119   2                io = 0x0D;
 120   2                io_cmp(io);
 121   2             }
 122   1            else io_status[13]=0;
 123   1            if((io_temp&0x48)==0x48)
 124   1             {
 125   2               io = 0x0E; 
 126   2               io_cmp(io);
 127   2             }
 128   1            else io_status[14]=0;   
 129   1            if((io_temp&0x88)==0x88) 
 130   1             {
 131   2               io = 0x0F;
 132   2               io_cmp(io);
 133   2             }
 134   1            else io_status[15]=0; 
 135   1         
 136   1      }
 137           
 138          
 139          void count(uchar i)
 140          {
 141   1              sum[i][5]++;
 142   1              if((sum[i][5]&0x0f)>0x09)
 143   1                      sum[i][5]=((sum[i][5]&0xf0)+0x10);      
 144   1          if(sum[i][5]>0x99)
 145   1          { 
 146   2              sum[i][4]++;
 147   2                      if((sum[i][4]&0x0f)>0x09)
 148   2                              sum[i][4]=((sum[i][4]&0xf0)+0x10);
 149   2              if(sum[i][4]>0x99)
 150   2              {
 151   3                      sum[i][3]++;
 152   3                              if((sum[i][3]&0x0f)>0x09)
 153   3                                      sum[i][3]=((sum[i][3]&0xf0)+0x10);
 154   3                      if(sum[i][3]>0x99)
 155   3                      {
 156   4                      sum[i][2]++;
 157   4                                      if((sum[i][2]&0x0f)>0x09)
 158   4                                              sum[i][2]=((sum[i][2]&0xf0)+0x10);        
 159   4                      if(sum[i][2]>0x99)
 160   4                      { 
 161   5                              sum[i][1]++;
 162   5                                              if((sum[i][1]&0x0f)>0x09)
 163   5                                                      sum[i][1]=((sum[i][1]&0xf0)+0x10);
 164   5                              if(sum[i][1]>0x99)
 165   5                              {
 166   6                                      sum[i][0]++;
 167   6                                                      if((sum[i][0]&0x0f)>0x09)
 168   6                                                              sum[i][0]=((sum[i][0]&0xf0)+0x10);
 169   6                                      if(sum[i][0]>0x99)
 170   6                                      sum[i][0]=0x00;
 171   6                                      
 172   6                                      sum[i][1]=0x00;
 173   6                              }
 174   5                              sum[i][2]=0x00; 
 175   5                      }
 176   4                      sum[i][3]=0x00;
 177   4                      }
 178   3                      sum[i][4]=0x00;
 179   3              }
C51 COMPILER V7.50   SCANKEY                                                               07/19/2006 10:05:16 PAGE 4   

 180   2              sum[i][5]=0x00; 
 181   2           }
 182   1      }
 183          
 184          void freezecount(uchar i)
 185          {
 186   1              freezesum[i][5]++;
 187   1              if((freezesum[i][5]&0x0f)>0x09)
 188   1                      freezesum[i][5]=((freezesum[i][5]&0xf0)+0x10);  
 189   1          if(freezesum[i][5]>0x99)
 190   1          { 
 191   2              freezesum[i][4]++;
 192   2                      if((freezesum[i][4]&0x0f)>0x09)
 193   2                              freezesum[i][4]=((freezesum[i][4]&0xf0)+0x10);
 194   2              if(freezesum[i][4]>0x99)
 195   2              {
 196   3                      freezesum[i][3]++;
 197   3                              if((freezesum[i][3]&0x0f)>0x09)
 198   3                                      freezesum[i][3]=((freezesum[i][3]&0xf0)+0x10);
 199   3                      if(freezesum[i][3]>0x99)
 200   3                      {
 201   4                      freezesum[i][2]++;
 202   4                                      if((freezesum[i][2]&0x0f)>0x09)
 203   4                                              freezesum[i][2]=((freezesum[i][2]&0xf0)+0x10);        
 204   4                      if(freezesum[i][2]>0x99)
 205   4                      { 
 206   5                              freezesum[i][1]++;
 207   5                                              if((freezesum[i][1]&0x0f)>0x09)
 208   5                                                      freezesum[i][1]=((freezesum[i][1]&0xf0)+0x10);
 209   5                              if(freezesum[i][1]>0x99)
 210   5                              {
 211   6                                      freezesum[i][0]++;
 212   6                                                      if((freezesum[i][0]&0x0f)>0x09)
 213   6                                                              freezesum[i][0]=((freezesum[i][0]&0xf0)+0x10);
 214   6                                      if(freezesum[i][0]>0x99)
 215   6                                      freezesum[i][0]=0x00;
 216   6                                      
 217   6                                      freezesum[i][1]=0x00;
 218   6                              }
 219   5                              freezesum[i][2]=0x00; 
 220   5                      }
 221   4                      freezesum[i][3]=0x00;
 222   4                      }
 223   3                      freezesum[i][4]=0x00;
 224   3              }
 225   2              freezesum[i][5]=0x00; 
 226   2           }
 227   1      }
 228          
 229          
 230          void io_process(uchar tmp)
 231          {
 232   1              register uchar i;
 233   1          for(i=tmp;i<tmp+4;i++)
 234   1              {
 235   2                      if (io_status[i]==0&&bak_status[i]==1)
 236   2                      {
 237   3                              bak_status[i]=0;
 238   3                              count(i);
 239   3                              if(FreezeFlag)
 240   3                                      freezecount(i); 
 241   3                                        
C51 COMPILER V7.50   SCANKEY                                                               07/19/2006 10:05:16 PAGE 5   

 242   3                      } 
 243   2              }
 244   1      
 245   1      }    
 246          
 247          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1738    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =    224    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      5    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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