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

📄 main.lst

📁 自动温度监测系统
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.50   MAIN                                                                  09/05/2007 12:18:55 PAGE 1   


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

line level    source

   1          /*****************************************************************
   2          *       浙江大学仪器系短学期实习项目:
   3          *       电仪2004级
   4          *       小组成员:韩灿 刘清文 赵岩 许琳燕
   5          *
   6          *       文件名  :
   7          *       开发人  :韩灿
   8          *       开发时间:2007-8-20
   9          *       版本    : v1。1
  10          *       修改者  :  韩灿 刘清文
  11          *       修改时间:2007-8-31
  12          *       修改说明:增加了状态机中上下限的读取
  13          ******************************************************************/
  14          #include<statement.h>
  15          #include<serial.h>
  16          #include<18b20.h>
  17          
  18          unsigned char flag;
  19          unsigned char low1,low2,high1,high2,H,L;
  20          unsigned char t, zz, key;
  21          typedef  enum { defaultState, currentTemp, transTemp,lowestTemp,highestTemp,high_alarm,low_alarm}Statement
             -;
  22          
  23          static Statement currentState = defaultState;
  24          
  25          /*****************************************************************
  26          *       函数名  :  statementmach
  27          *       功能    : 状态机
  28          *       输入参数: 
  29          *               Param1:unsigned char key
  30          *               Param2:
  31          *               Param3:
  32          *       输出参数:
  33          *               Param1:
  34          *               Param2:
  35          *               Param3:
  36          *       返回值  :
  37          ******************************************************************/
  38          void statementmach(unsigned char key)
  39          {
  40   1      
  41   1              
  42   1              switch( currentState)
  43   1              {
  44   2                      case defaultState :               /////////////////
  45   2                              if(key==S0)
  46   2                              { 
  47   3                                      defaultDisplay(flag);
  48   3                                      currentState = defaultState;
  49   3                              }
  50   2                              
  51   2                              if (key == S1) 
  52   2                              {
  53   3                                      currentTempDisplay(t,zz);
  54   3                                      currentState = currentTemp;
C51 COMPILER V7.50   MAIN                                                                  09/05/2007 12:18:55 PAGE 2   

  55   3                                      
  56   3                              }
  57   2                              
  58   2                              if(key == S2) 
  59   2                              {
  60   3                                      transTempDisplay(t,zz);
  61   3                                      currentState = transTemp;
  62   3                              }
  63   2                              if(key==0xff)
  64   2                              {
  65   3                                       defaultDisplay(flag);
  66   3                                      currentState = defaultState;
  67   3                              } 
  68   2                              break;
  69   2                      
  70   2                      case currentTemp:                  /////////////////
  71   2                              if(key == S2) 
  72   2                              {
  73   3                                      transTempDisplay(t,zz);
  74   3                                      currentState = transTemp;
  75   3                              } 
  76   2                              
  77   2                              if(key==S0)
  78   2                              { 
  79   3                                      defaultDisplay(flag);
  80   3                                      currentState = defaultState;
  81   3                              }
  82   2                              
  83   2                              if (key == S1) 
  84   2                              {
  85   3                                      lowestTempDisplay(low1,low2);
  86   3                                      currentState = lowestTemp;
  87   3                                      
  88   3                              }
  89   2      
  90   2                              if (key == 0xff) 
  91   2                              {
  92   3                                      currentTempDisplay(t,zz);
  93   3                                      currentState = currentTemp;
  94   3                              }
  95   2                              
  96   2                              break;
  97   2                      
  98   2                      case transTemp:                                  ////////////////
  99   2                              
 100   2                              if(key == S2)  
 101   2                              {
 102   3                                      high_alarmDisplay(H);
 103   3                                      currentState = high_alarm;
 104   3                              }
 105   2                              
 106   2                              if(key==S0)
 107   2                              { 
 108   3                                      defaultDisplay(flag);
 109   3                                      currentState = defaultState;
 110   3                              }
 111   2                              
 112   2                              if (key == S1) 
 113   2                              {
 114   3                                      currentTempDisplay(t,zz);
 115   3                                      currentState = currentTemp;
 116   3                                      
C51 COMPILER V7.50   MAIN                                                                  09/05/2007 12:18:55 PAGE 3   

 117   3                              }
 118   2      
 119   2                              if (key == 0xff) 
 120   2                              {
 121   3                                      transTempDisplay(t,zz);
 122   3                                      currentState = transTemp;
 123   3                              }       
 124   2                              break;
 125   2      
 126   2                      case high_alarm:
 127   2                               if(key==S0)
 128   2                              { 
 129   3                                      defaultDisplay(flag);
 130   3                                      currentState = defaultState;
 131   3                              }
 132   2                              
 133   2                              if (key == S1) 
 134   2                              {
 135   3                                      currentTempDisplay(t,zz);
 136   3                                      currentState = currentTemp;
 137   3                                      
 138   3                              }
 139   2                              if(key == S2) 
 140   2                              {
 141   3                                      low_alarmDisplay(L);
 142   3                                      currentState = low_alarm;
 143   3                              }
 144   2                              if (key == 0xff) 
 145   2                              {
 146   3                                      high_alarmDisplay(H);
 147   3                                      currentState = high_alarm;
 148   3                              }
 149   2                              break;
 150   2      
 151   2                      case low_alarm:
 152   2                                if(key==S0)
 153   2                              { 
 154   3                                      defaultDisplay(flag);
 155   3                                      currentState = defaultState;
 156   3                              }
 157   2                              
 158   2                              if (key == S1) 
 159   2                              {
 160   3                                      currentTempDisplay(t,zz);
 161   3                                      currentState = currentTemp;
 162   3                                      
 163   3                              }
 164   2                              if(key==S2)

⌨️ 快捷键说明

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