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

📄 baojian.lst

📁 一个电子灸疗器的源码。 一个电子灸疗器的源码。
💻 LST
📖 第 1 页 / 共 4 页
字号:
C51 COMPILER V7.07   BAOJIAN                                                               10/15/2007 23:33:26 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 123
  24          #define _15S  296
  25          #define _2S 40
  26          #define _12S 240
  27          #define _30fen 36000
  28          #define _7fen5 9000
  29          #define _1S 20
  30          #define _05S 90//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          bit first_sel=0;
  50          bit working_flag=0;
  51          bit first_power_on=0;
  52          /*****************************************************/
  53          #include"stc_flash.c"
  54          //***************************************************/
  55          //50ms定时器0中断服务程序
C51 COMPILER V7.07   BAOJIAN                                                               10/15/2007 23:33:26 PAGE 2   

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

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

 180   1      }
 181          //***********************************************
 182          //mid(); 中加热程序
 183          //***********************************************
 184          void mid(void)
 185          {
 186   1              TR0=1;
 187   1              TR1=0;
 188   1              bell=0;
 189   1              if(first_sel==0)
 190   1              {
 191   2              D1=D2=D3=D4=0;
 192   2              working_flag=1;
 193   2              step=0x01;
 194   2              }
 195   1              if(first_power_on==0)
 196   1                      {
 197   2                              first_power_on=1;
 198   2                         }
 199   1                          else
 200   1                         {
 201   2                         step=0x03;
 202   2                              heathigh=1;
 203   2                         }
 204   1              first_sel=1;
 205   1              time_fly1=0;
 206   1              time_fly=0;
 207   1              

⌨️ 快捷键说明

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