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

📄 main.lst

📁 上学时做的一个51单片机按键显示程序
💻 LST
字号:
C51 COMPILER V7.07   MAIN                                                                  11/25/2005 20:21:56 PAGE 1   


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

stmt level    source

   1          /*
   2          * Copyright(c)2005 - 2009 danise .China
   3          * All rights reserved.
   4          * Redistribution and use in source and bianry forms
   5          * with or without modification ,are permitted provided
   6          * that following conditions are met:
   7          * 
   8          * 1.Redistrubution of source code must retain the 
   9          * above copyright notice,this list of conditions and
  10          * following disclaimer.
  11          * 
  12          * 2.Redistributions in binary form must reproduce the 
  13          * above copyright notice,this list of conditions and 
  14          * following disclaimer in the documentation and /or other
  15          * materials provided with the distribution.
  16          * 
  17          * Alternately, this acknowledgment may appear in the software
  18          * itself,if and wherever such third-party acknowledgements
  19          * normally appear.
  20          *
  21          * This software is designed for key board and led display.
  22          * 
  23                  
  24          */
  25          #include "./include/datatypes.h"
  26          #include "./include/init.h"
  27          #include "./include/global.h"
  28          #include "./include/display.h"
  29          #include "./include/system.h"
  30          #include "./include/i2c.h"
  31          
  32          /*************************************************\
  33          *a global variable for system events control.
  34          *some event constants are define in file system.h
  35          **************************************************/
  36          UINT8 volatile event_word = 0;
  37          
  38          
  39          void Initialize_ISP();
  40          void SystemEventsAnalyse();
  41          void main()
  42          {
  43   1              
  44   1              
  45   1              /* system initialization */
  46   1              /* 932 ports initalization */
  47   1              CP932PortInit();
  48   1              
  49   1              
  50   1              /**************   ISP  ******************\
  51   1          \****************dangerous***************/
  52   1              PIN_ISP=1;
  53   1              if(PIN_ISP==0)                                  
  54   1              {
  55   2                      RxD=0;
C51 COMPILER V7.07   MAIN                                                                  11/25/2005 20:21:56 PAGE 2   

  56   2                      Initialize_ISP();
  57   2              }
  58   1              
  59   1              /******************  ********************/
  60   1              /* i2c intialization */
  61   1              InitIIC();
  62   1      
  63   1          /* Timer0 initialization ,timer0 will produce
  64   1                 interruptions for scaning keyboard*/
  65   1              CP932Timer0Init();
  66   1          /* Timer1 init.for system clock */
  67   1              CP932Timer1Init();
  68   1          
  69   1              CP932ISRInit();
  70   1              InitSysData();
  71   1              CheckLeds();
  72   1              CkeckLights();
  73   1              RegisterMachine();
  74   1          sreensaveclk =0;
  75   1              while( 1 )
  76   1              {
  77   2                      CheckSreenSave();
  78   2                      ProcessI2cRecvFrame();
  79   2                      SystemEventsAnalyse();
  80   2              }
  81   1      
  82   1      }
  83          
  84          void Initialize_ISP()
  85          {
  86   1              SCON = 0x50; /* select the Baud Rate Generator as UART baud rate source*/
  87   1              BRGR1 = 0x04; /* 9600 BAUD at 11.0592 MHz*/
  88   1              BRGR0 = 0x70;
  89   1              BRGCON = 0x03; /* enable BRG */
  90   1              AUXR1 |= 0x40; /* enable reset on break detect by setting EBRR */
  91   1      
  92   1      }
  93          /*
  94          * Analyse system events ,and to do the specified process.
  95          */
  96          void SystemEventsAnalyse()
  97          {
  98   1              UINT8 event_word_copy;  
  99   1              event_word_copy = event_word ;   
 100   1          
 101   1              if( event_word_copy & EVENT_SCREEN_SAVE ){
 102   2                      Enter_Critical_OS();
 103   2                      event_word &=( ~EVENT_SCREEN_SAVE );
 104   2                      Exit_Critical_OS();
 105   2                      SaveSreen();
 106   2              }
 107   1              
 108   1              if( event_word_copy & EVENT_LED_DOWN_UPDATE ){
 109   2                      Enter_Critical_OS();
 110   2                      event_word &=( ~EVENT_LED_DOWN_UPDATE );
 111   2                      Exit_Critical_OS();
 112   2                      /* invoke led show  function UpateLeds() */
 113   2                      UpateDownLeds();
 114   2              } 
 115   1      
 116   1              if(event_word_copy & EVENT_I2C_DATA_SEND ){
 117   2                      Enter_Critical_OS();
C51 COMPILER V7.07   MAIN                                                                  11/25/2005 20:21:56 PAGE 3   

 118   2                      event_word &=( ~ EVENT_I2C_DATA_SEND );
 119   2                      Exit_Critical_OS();     
 120   2                      /*invoke i2csend */
 121   2                      I2cSendFrame( 0x0c );
 122   2              }
 123   1      
 124   1              
 125   1      
 126   1      }


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


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

⌨️ 快捷键说明

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