C51 COMPILER V9.53.0.0   STC_IT                                                            08/06/2020 09:19:44 PAGE 1   


C51 COMPILER V9.53.0.0, COMPILATION OF MODULE STC_IT
OBJECT MODULE PLACED IN ..\output\stc_it.obj
COMPILER INVOKED BY: D:\Program Files\Keil_c5\C51\BIN\C51.EXE ..\Peripherals\src\stc_it.c LARGE OPTIMIZE(8,SPEED) BROWSE
                    - INCDIR(..\Peripherals\inc\) DEBUG OBJECTEXTEND PRINT(..\lis\stc_it.lst) TABS(2) OBJECT(..\output\stc_it.obj)

line level    source

   1          #include "stc_it.h"
   2          #include "usart.h"
   3          #include "string.h"
   4          //外部中断1
   5          uint8_t stata=0;
   6          void EXTI1_IRQHandler(void)interrupt 2
   7          {
   8   1      }
   9          //串口中断
  10          void USART_IRQHandler(void)interrupt 4
  11          {
  12   1        static uint8_t i=0,rebuf[30]={0};
  13   1        uint8_t sum=0;
  14   1          if(TI)//发送完成标志
  15   1        {
  16   2          TI=0;//清发送完成标志
  17   2          send_ok=0;//缓存标志置0 
  18   2        }
  19   1        if(RI)//接收完成标志
  20   1        {
  21   2          rebuf[i++]=SBUF;
  22   2          RI=0;//清中断接收标志
  23   2              if (rebuf[0]!=add)//帧头不对
  24   2                  i=0;
  25   2              else if ((i==2)&&(rebuf[1]!=0x03))//帧头不对
  26   2                  i=0;
  27   2              else if ((i==3)&&(rebuf[2]>16))//帧头不对
  28   2                  i=0;
  29   2              else if ((i==4)&&(rebuf[3]>16))//帧头不对
  30   2                  i=0;
  31   2              if(i>3)//i等于4时，已经接收到数据量字节rebuf[3]
  32   2              {
  33   3                  if(i<21)
  34   3                  {
  35   4                      if(i==(rebuf[3]+5))//判断是否接收一帧数据完毕
  36   4                      {
  37   5      
  38   5                          if(!Receive_ok)//当数据处理完成后才接收新的数据
  39   5                          {
  40   6                              memcpy(usart_rx_data,rebuf,i);//拷贝接收到的数据
  41   6                              Receive_ok=1;//接收完成标志
  42   6                          }
  43   5                          i=0;//缓存清0
  44   5      
  45   5                      }
  46   4                  }
  47   3                  else
  48   3                  i=0;
  49   3              }
  50   2        
  51   2        }
  52   1      
  53   1      }

C51 COMPILER V9.53.0.0   STC_IT                                                            08/06/2020 09:19:44 PAGE 2   


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    237    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =     32       1
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


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