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

📄 baojian.lst

📁 一个电子灸疗器的源码。 一个电子灸疗器的源码。
💻 LST
📖 第 1 页 / 共 3 页
字号:
C51 COMPILER V7.07   BAOJIAN                                                               10/12/2007 13:39:15 PAGE 1   


C51 COMPILER V7.07, COMPILATION OF MODULE BAOJIAN
OBJECT MODULE PLACED IN Baojian.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Baojian.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          #include <intrins.h>
   2          #include"stc12c2052.h"
   3          
   4          #define heatlow P3_5
   5          #define heathigh P3_7
   6          #define D1 P1_0
   7          #define D2 P1_1
   8          #define D4 P1_3
   9          #define larmlight P1_4
  10          #define D3 P1_2
  11          #define bell P3_4
  12          #define Door P1_7
  13          #define strong_key P1_5
  14          #define mid_key P1_6
  15          #define lack_key P3_3
  16          #define on_off P3_2
  17          #define uchar unsigned char
  18          #define uint unsigned int
  19          #define _BIN(a,b,c,d,e,f,g,h) ((a<<7)+(b<<6)+(c<<5)+(d<<4)+(e<<3)+(f<<2)+(g<<1)+(h<<0))
  20          #define _bin _BIN // _bin,_BIN均可
  21          #define _20S 400
  22          #define _60S 1200
  23          #define _6S 120
  24          #define _15S  300
  25          #define _2S 40
  26          #define _12S 240
  27          #define _30fen 36000
  28          #define _7fen5 9000
  29          #define _1S 20
  30          #define _05S 10
  31          #define _01S 2
  32          
  33          
  34          //************************************************
  35          //公用变量
  36          ///******************************************
  37          uchar mode=0x00;
  38          uchar liaocheng=0x00;
  39          uchar bell_style=0x00;
  40          uchar time_going=0x00;
  41          uchar step=0x00;
  42          uint time_start=0x00;
  43          uint time_count=0x0000;
  44          uint time_fly=0x00;
  45          uint time_fly1=0x00;
  46          uint time_bell=0x00;
  47          uint time_flash=0x0000;
  48          bit power_flag=0;
  49          //***************************************************/
  50          //50ms定时器0中断服务程序
  51          /////////////////////////////////////////////////////
  52          void timer0_50ms (void) interrupt 1 using 3
  53              {
  54   1               TH0=0xfa;
  55   1               TL0=0x00;
C51 COMPILER V7.07   BAOJIAN                                                               10/12/2007 13:39:15 PAGE 2   

  56   1           time_start++;  
  57   1               time_count++;
  58   1          }
  59          /***************************************************
  60          //delay05S()延时程序
  61          /////////////////////////////////////////////////////
  62          void delay05S(void)
  63          {
  64                  uchar i,b;
  65                  for(i=0x5;i>0;i--)
  66                  {
  67                          for(b=0x5;b>0;b--);
  68                  }
  69          }
  70          //***************************************************/
  71          //LED_flash()定时器1中断服务程序
  72          /////////////////////////////////////////////////////
  73          void timer1_LED (void) //interrupt 3 using 2
  74              {
  75   1               //TH1=0x00;
  76   1               //TL1=0x00;
  77   1           time_flash++; 
  78   1           switch(mode)
  79   1                      {
  80   2                              case 0x01:
  81   2                                      {
  82   3                                              if(time_flash>4000)
  83   3                                              {
  84   4                                                      P3M1=_bin(1,0,1,0,1,1,0,0);//P3M1=0x0C; P3_3,P3_2//设为强输出驱动LED 
  85   4                                                      _nop_();
  86   4                                                      P1M1=_bin(1,1,1,0,0,0,0,0);//P1M1=_0x30; P1_6,P1_5//设为强输出驱动LED
  87   4                                                      _nop_();
  88   4                                                  mid_key=lack_key=1;
  89   4                                                      _nop_();
  90   4                                                      strong_key=~strong_key;
  91   4                                                      _nop_();
  92   4                                                      time_flash=0x00;
  93   4                                              }
  94   3                                              break;
  95   3                                      }
  96   2                              case 0x02:
  97   2                                      {
  98   3                                              if(time_flash>4000)
  99   3                                              {       _nop_();
 100   4                                                      P3M1=_bin(1,0,1,0,1,1,0,0);//P3M1=0x0C; P3_3,P3_2//设为强输出驱动LED 
 101   4                                                      _nop_();
 102   4                                                      P1M1=_bin(1,1,1,0,0,0,0,0);//P1M1=_0x30; P1_6,P1_5//设为强输出驱动LED
 103   4                                                  _nop_();
 104   4                                                      strong_key=lack_key=1;
 105   4                                                      _nop_();
 106   4                                                      mid_key=~mid_key;
 107   4                                                      _nop_();
 108   4                                                      time_flash=0x00;
 109   4                                                      _nop_();
 110   4                                              }
 111   3                                              break;
 112   3                                      }
 113   2                              case 0x03:
 114   2                                      {
 115   3                                              if(time_flash>4000)
 116   3                                              {       _nop_();
 117   4                                                      P3M1=_bin(1,0,1,0,1,1,0,0);//P3M1=0x0C; P3_3,P3_2//设为强输出驱动LED 
C51 COMPILER V7.07   BAOJIAN                                                               10/12/2007 13:39:15 PAGE 3   

 118   4                                                      _nop_();
 119   4                                                      P1M1=_bin(1,1,1,0,0,0,0,0);//P1M1=_0x30; P1_6,P1_5//设为强输出驱动LED
 120   4                                                  _nop_();
 121   4                                                      mid_key=strong_key=1;
 122   4                                                      _nop_();
 123   4                                                      lack_key=~lack_key;
 124   4                                                      _nop_();
 125   4                                                      time_flash=0x00;
 126   4                                                      _nop_();
 127   4                                              }
 128   3                                              break;
 129   3                                      }
 130   2                              default :break;
 131   2                      }
 132   1          }
 133          //***********************************************
 134          //strong(); 强加热程序
 135          //***********************************************
 136          void strong(void)
 137          {
 138   1              TR0=1;
 139   1              TR1=0;
 140   1              if(mode!=0x01)
 141   1              {liaocheng=0x00;}
 142   1              D1=D2=D3=D4=0;
 143   1              bell=0;
 144   1              step=0x01;
 145   1              mode=0x01;
 146   1      //      bell_style=0x02;        
 147   1      }
 148          //***********************************************
 149          //mid(); 中加热程序
 150          //***********************************************
 151          void mid(void)
 152          {
 153   1              TR0=1;
 154   1              TR1=0;
 155   1              if(mode!=0x02)
 156   1              {liaocheng=0x00;}
 157   1              bell=0;
 158   1              D1=D2=D3=D4=0;
 159   1              step=0x01;
 160   1              mode=0x02;
 161   1      }
 162          //***********************************************
 163          //lack(); 弱加热程序
 164          //***********************************************
 165          void lack(void)
 166          {
 167   1              TR0=1;
 168   1              TR1=0;
 169   1              if(mode!=0x03)
 170   1              {liaocheng=0x00;}
 171   1              D1=D2=D3=D4=0;
 172   1              bell=0;
 173   1              step=0x01;
 174   1              mode=0x03;
 175   1      }
 176          //*********************************************
 177          //alarm();
 178          //*********************************************
 179          void alarm(void)
C51 COMPILER V7.07   BAOJIAN                                                               10/12/2007 13:39:15 PAGE 4   

 180          {
 181   1              
 182   1              if(time_count>_7fen5)
 183   1              {
 184   2                      
 185   2                      if(D4==0)
 186   2                              {
 187   3                                      D4=1;time_count=0x00;
 188   3                              }
 189   2                              else if(D3==0)
 190   2                                      {
 191   3                                              D3=1;time_count=0x00;
 192   3                                      }
 193   2                                              else if(D2==0)
 194   2                                              {
 195   3                                                      D2=1;time_count=0x00;
 196   3                                              }
 197   2                                                      else if(D1==0)
 198   2                                                      {
 199   3                                                              D1=1;
 200   3                                                              time_count=0x00;
 201   3                                                      //      larmlight=0;
 202   3                                                              //TR0=0;
 203   3                                                              TR1=1;
 204   3                                                              liaocheng++;
 205   3                                                              bell_style=0x01;                                                        
 206   3                                                      }
 207   2                                                              if((D1==1)&(liaocheng<3))
 208   2                                                                      {
 209   3                                                                                      mode=0x00;
 210   3                                                                                                      P3M1=_bin(1,0,1,0,1,1,0,0);
 211   3                                                                                                      P3M0=_bin(0,0,0,0,0,0,0,0);
 212   3                                                                                                      P1M1=_bin(1,1,1,0,0,0,0,0);
 213   3                                                                                                      P1M0=_bin(1,0,0,0,0,0,0,0);
 214   3                                                                                                      _nop_();
 215   3                                                                                                      strong_key=mid_key=lack_key=1;
 216   3                                                                                                      heathigh=0;
 217   3                                                                                      if((time_count>_60S)&(liaocheng<3))
 218   3                                                                                              {
 219   4                                                                                                      TR1=0;

⌨️ 快捷键说明

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