C51 COMPILER V8.08   IR_RECEIVE                                                            07/28/2012 21:52:50 PAGE 1   


C51 COMPILER V8.08, COMPILATION OF MODULE IR_RECEIVE
OBJECT MODULE PLACED IN IR_Receive.OBJ
COMPILER INVOKED BY: D:\Program Files\keil_51\C51\BIN\C51.EXE IR_Receive.c LARGE BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include "NEW_8051.H"
   2          #include "task.h"
   3          uchar  irtime;//红外用全局变量
   4          bit new_code;
   5          uchar IRcord[2];
   6          uchar irdata[17];
   7          uchar key_code;
   8          /************************************************/
   9          void tim1_isr (void) interrupt 3 using 1//定时器1中断服务函数
  10          {
  11   1        irtime++;
  12   1      }
  13          /*************************************************************/
  14          //外部中断1解码程序
  15          void ex1_isr (void) interrupt 2 using 2//外部中断1服务函数
  16          {
  17   1          static uchar i,p,z;
  18   1          static bit startflag;
  19   1          TR1=1;
  20   1          if(startflag)
  21   1          {        
  22   2              if(irtime<100&&irtime>=53)//引导码 TC9012的头码
  23   2              { 
  24   3                  i=0;
  25   3                  p=1;
  26   3                  z=0;
  27   3                  irdata[i]=irtime;
  28   3                  irtime=0;
  29   3              }
  30   2              z++;
  31   2              if(z>=18)
  32   2              {
  33   3                  irdata[p]=irtime;
  34   3                  irtime=0;
  35   3                  p++;
  36   3                  if(p==17)
  37   3                  {
  38   4                      new_code=1;
  39   4                      p=0;
  40   4                                      TR1=0;
  41   4                  }     
  42   3              }
  43   2              else 
  44   2                  irtime=0;          
  45   2              
  46   2          }   
  47   1          else
  48   1          {
  49   2              irtime=0;
  50   2              startflag=1;
  51   2          }
  52   1      }
  53          /************************************************/
  54          void Ircordpro(void)//红外码值处理函数
  55          {
C51 COMPILER V8.08   IR_RECEIVE                                                            07/28/2012 21:52:50 PAGE 2   

  56   1          uchar i, j, k;
  57   1          uchar cord,value;
  58   1          
  59   1          k=1;
  60   1          for(i=0;i<2;i++)//处理4个字节
  61   1          {
  62   2           for(j=1;j<=8;j++) //处理1个字节8位
  63   2          {
  64   3              cord=irdata[k];
  65   3          if(cord>11)//大于某值为1
  66   3          {
  67   4              value=value|0x80;
  68   4          }
  69   3          else
  70   3          {
  71   4              value=value;
  72   4          }
  73   3          if(j<8)
  74   3          {
  75   4              value=value>>1;
  76   4          }
  77   3              k++;
  78   3          }
  79   2              IRcord[i]=value;
  80   2              value=0;    
  81   2          }
  82   1              key_code=IRcord[0]; 
  83   1      
  84   1      } 


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    230    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =     24    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =      2    ----
END OF MODULE INFORMATION.


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