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

📄 main.lst

📁 C8051F330部分模块程序,已经调试成功
💻 LST
字号:
C51 COMPILER V7.50   MAIN                                                                  07/09/2007 11:14:27 PAGE 1   


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

line level    source

   1          //File name:main.c
   2          //Autor:Liuyul
   3          //Date:2006-08-09
   4          //Description:Making the operiton of whole system,share moble and work;
   5          //Call:  
   6          //                      /d/YH2/Keyboard.c   
   7          //                      /d/YH2/Wind.c       
   8          //                      /d/YH2/Display.c   
   9          //                      /d/YH2/Head.h   
  10          //                      /d/YH2/Func.f       
  11          //                      /d/YH2/Gobale.inc    
  12          //                      /d/YH2/Interrupt.c
  13          //                      /d/YH2/Struct.str
  14          // History: Date     Autor         Vision
  15          //       2006-08-07  Liuyulong        2.1
  16          #include <330_head.h>
  17          #include "330_func.h"
  18          #include "330_Gobale.h"
  19          #include "330_struct.h"
  20          #include "330_display.c"
  21          #include "330_keyboard.c"
  22          #include "330_wind.c"
  23          #include "330_Interrupt.c"
  24          #define test 0
  25          #define loop 30
  26          extern unsigned xdata first;
  27          extern unsigned xdata lastsetuptemp;
  28          extern unsigned xdata lastsetupwind;
  29          extern unsigned xdata lastsetupflap;
  30          extern unsigned xdata lastsetupmode;
  31          extern unsigned xdata lastsetupaddr;
  32          extern xdata unsigned char screenkeep;           //屏保寄存器
  33          extern bit powersize ;  
  34          struct keyboard out ;   
  35          struct screen setdata ; 
  36          unsigned char loopnum ;
  37          main(){
  38   1      unsigned char main_keynum ;
  39   1      //unsigned char res_root ;
  40   1      disableWDT() ;             //关闭看门狗 
  41   1      enableWDT () ;
  42   1      refreshWDT() ;
  43   1      SYSCLK_Init () ;                //the clock of system set up;
  44   1      refreshWDT() ;
  45   1      PORT_Init () ;
  46   1      rstsrc = 0 ;
  47   1      ref0cn = 0x0b ;
  48   1      top = 0 ; 
  49   1      battom = 0 ;
  50   1      refreshWDT() ;
  51   1      write(0,0,0) ;
  52   1      refreshWDT() ;
  53   1      del1s () ;
  54   1      //set up Interrupt;
  55   1      eie1 = 0x18 ;           //Enable interrupt ADC0;
C51 COMPILER V7.50   MAIN                                                                  07/09/2007 11:14:27 PAGE 2   

  56   1      eip1 = 0x08 ;
  57   1      ie = 0x10 ;                      
  58   1      if(first != 0xaa){                        //The system first opration initial; 
  59   2              first = 0x55 ;
  60   2              out.temp = temp_int_num ;             //Initial temperation is 22;
  61   2              out.wind = wind_int_speed ;           //Initial wind is 10;
  62   2              out.automode = 1 ;                               //Initial auto mode ;
  63   2              out.addressl = mobleaddr & 0x0f ;        //Initial low Byte system address 
  64   2              out.addressh = mobleaddr >> 4 ;          //Initial high Byte system address;
  65   2              out.addressh &= 0x0f ;
  66   2              }
  67   1      else {                                                                   //After Lost power and start,system will initial ;
  68   2              out.addressl = lastsetupaddr & 0x0f;//reset the low byte system address;     
  69   2              out.addressh = lastsetupaddr >> 4 ;      
  70   2              out.addressh &= 0x0f ;                           //reset the high byte system address;
  71   2              out.temp = lastsetuptemp ;                       //reset the temperature num;
  72   2              out.wind = lastsetupwind ;                       //reset the PWM of wind ;
  73   2              out.automode = lastsetupmode ;           //reset the auto mode;
  74   2              }
  75   1              refreshWDT() ;
  76   1      powersize = 1 ;          //System bize is true,the system will stop;
  77   1      while(powersize == 1)                              
  78   1                              {
  79   2                              ea = false;                            //Stop AC electrial machinery ;
  80   2                              led = 1 ;                      //Close LCD light ;
  81   2                              closelcd();                                //Close LCD ; 
  82   2                              refreshWDT() ;
  83   2                              main_keynum = keyscan ();
  84   2                              while (main_keynum == 4)                           //If the key "POWER" is not press,wait for press ;
  85   2                                  { 
  86   3                                      main_keynum = keyscan ();
  87   3                                      refreshWDT() ;
  88   3                                      powersize = 0 ;                  //Power size is false means system is working ;
  89   3                              //      res_root = rstsrc ;
  90   3                              //    res_root &= 0x08 ;
  91   3                              //  if(res_root == 0x08){
  92   3                              //      main_keynum = 4 ;
  93   3                              //      rstsrc &= 0xf7 ;
  94   3                              //      }
  95   3                                      }
  96   2                                      }
  97   1      ea = 1; //Open the totle gate of Interrupt;
  98   1      led = 0 ;
  99   1      screenkeep = 0 ;
 100   1      PCA_Init () ;
 101   1      refreshWDT() ;
 102   1      out.menu = 1 ;
 103   1      tempcheck ();
 104   1      refreshWDT() ;
 105   1      tempcheck ();
 106   1      refreshWDT() ;
 107   1      display ();
 108   1      refreshWDT() ;
 109   1      /*
 110   1      for (loopnum = 0;loopnum  < loop ;loopnum ++){
 111   1      for (;screenkeep < 30;){
 112   1              keyboard ();
 113   1              PCA_Init () ;
 114   1              led = 0;
 115   1              }
 116   1              led = 1;
 117   1              out.menu = 0;
C51 COMPILER V7.50   MAIN                                                                  07/09/2007 11:14:27 PAGE 3   

 118   1              display ();
 119   1              keyboard ();
 120   1              tempcheck ();                                           
 121   1              numone(setdata.tempnum%10);         //Temperature of house at LED one ;
 122   1              numten(setdata.tempnum/10);             //Temperature of house at LED ten ;
 123   1              del1s();
 124   1              }
 125   1              */
 126   1      while(1){
 127   2      tempcheck ();                                           //Check the temperature of house ;
 128   2      refreshWDT() ;
 129   2      coolauto();  
 130   2      refreshWDT() ;
 131   2      for (loopnum = 0;loopnum  < loop ;loopnum ++){
 132   3      for (;screenkeep < 49;){
 133   4              keyboard ();
 134   4              refreshWDT() ;
 135   4              led = 0;
 136   4              del1s () ;
 137   4              refreshWDT() ;
 138   4              }
 139   3              refreshWDT() ;                                          
 140   3      //      battom_size =~battom_size ;
 141   3              led = 1;
 142   3              out.menu = 0;
 143   3              keyboard ();
 144   3              refreshWDT() ;
 145   3              lastsetuptemp = out.temp;                       //Save the set num of temperature; 
 146   3              lastsetupwind = out.wind;                       //Save the set num of wind ;
 147   3              lastsetupmode = out.automode;           //Save the set num of mode ;
 148   3              del1s () ;
 149   3              }
 150   2      }
 151   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   2643    ----
   CONSTANT SIZE    =    233    ----
   XDATA SIZE       =     36    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     25      19
   IDATA SIZE       =   ----    ----
   BIT SIZE         =      1       6
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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