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

📄 simple_eos.lst

📁 Keil uVision2下用C语言开发的牛奶巴斯德杀菌嵌入式系统代码
💻 LST
字号:
C51 COMPILER V6.21  SIMPLE_EOS                                                             01/23/2002 17:54:56 PAGE 1   


C51 COMPILER V6.21, COMPILATION OF MODULE SIMPLE_EOS
OBJECT MODULE PLACED IN Simple_EOS.OBJ
COMPILER INVOKED BY: C:\KEIL\C51\BIN\C51.EXE Simple_EOS.c OPTIMIZE(6,SPEED) BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          /*------------------------------------------------------------------*-
   2          
   3             Simple_EOS.C (v1.00)
   4          
   5            ------------------------------------------------------------------
   6          
   7             Main file for Simple Embedded Operating System (sEOS) for 8051. 
   8          
   9             -- This version for milk-flow-rate monitoring.
  10          
  11          
  12             COPYRIGHT
  13             ---------
  14          
  15             This code is associated with the book:
  16          
  17             EMBEDDED C by Michael J. Pont 
  18             [Pearson Education, 2002: ISBN: 0-201-79523-X].
  19          
  20             This code is copyright (c) 2001 by Michael J. Pont.
  21           
  22             See book for copyright details and other information.
  23          
  24          -*------------------------------------------------------------------*/
  25          
  26          #include "Main.H"
  27          #include "Simple_EOS.H"
  28          
  29          #include "Pulse_count.H"
  30          
  31          
  32          /*------------------------------------------------------------------*-
  33            
  34            sEOS_ISR()
  35          
  36            Invoked periodically by Timer 2 overflow: 
  37            see sEOS_Init_Timer2() for timing details.
  38          
  39          -*------------------------------------------------------------------*/
  40          void sEOS_ISR() interrupt INTERRUPT_Timer_2_Overflow
  41             {
  42   1         // Must manually reset the T2 flag 
  43   1         TF2 = 0;    
  44   1      
  45   1         //===== USER CODE - Begin =======================================
  46   1      
  47   1         // Call 'Update' function here
  48   1         PULSE_COUNT_Update();
  49   1      
  50   1         //===== USER CODE - End =========================================
  51   1         }
  52          
  53          /*------------------------------------------------------------------*-
  54            
  55            sEOS_Init_Timer2()
C51 COMPILER V6.21  SIMPLE_EOS                                                             01/23/2002 17:54:56 PAGE 2   

  56          
  57            Sets up Timer 2 to drive the simple EOS.
  58          
  59            Parameter gives tick interval in MILLISECONDS.
  60          
  61            Max tick interval is ~60ms (12 MHz oscillator).
  62          
  63            Note: Precise tick intervals are only possible with certain 
  64            oscillator / tick interval combinations.  If timing is important,
  65            you should check the timing calculations manually. 
  66          
  67          -*------------------------------------------------------------------*/
  68          void sEOS_Init_Timer2(const tByte TICK_MS)
  69             {
  70   1         tLong Inc;
  71   1         tWord Reload_16;
  72   1         tByte Reload_08H, Reload_08L;
  73   1      
  74   1         // Timer 2 is configured as a 16-bit timer,
  75   1         // which is automatically reloaded when it overflows
  76   1         T2CON   = 0x04;   // Load Timer 2 control register
  77   1      
  78   1         // Number of timer increments required (max 65536)
  79   1         Inc = ((tLong)TICK_MS * (OSC_FREQ/1000)) / (tLong)OSC_PER_INST;   
  80   1      
  81   1         // 16-bit reload value
  82   1         Reload_16 = (tWord) (65536UL - Inc);
  83   1      
  84   1         // 8-bit reload values (High & Low)
  85   1         Reload_08H = (tByte)(Reload_16 / 256);
  86   1         Reload_08L = (tByte)(Reload_16 % 256);
  87   1      
  88   1         // Used for manually checking timing (in simulator)
  89   1         //P2 = Reload_08H;
  90   1         //P3 = Reload_08L;
  91   1      
  92   1         TH2     = Reload_08H;   // Load Timer 2 high byte
  93   1         RCAP2H  = Reload_08H;   // Load Timer 2 reload capt. reg. high byte
  94   1         TL2     = Reload_08L;   // Load Timer 2 low byte
  95   1         RCAP2L  = Reload_08L;   // Load Timer 2 reload capt. reg. low byte
  96   1      
  97   1         // Timer 2 interrupt is enabled, and ISR will be called 
  98   1         // whenever the timer overflows.
  99   1         ET2     = 1;
 100   1      
 101   1         // Start Timer 2 running
 102   1         TR2   = 1;     
 103   1      
 104   1         EA = 1;            // Globally enable interrupts
 105   1         }
 106          
 107          /*------------------------------------------------------------------*-
 108            
 109            sEOS_Go_To_Sleep()
 110          
 111            This operating system enters 'idle mode' between clock ticks
 112            to save power.  The next clock tick will return the processor
 113            to the normal operating state.
 114          
 115            *** ADAPT AS REQUIRED FOR YOUR HARDWARE ***
 116          
 117          -*------------------------------------------------------------------*/
C51 COMPILER V6.21  SIMPLE_EOS                                                             01/23/2002 17:54:56 PAGE 3   

 118          void sEOS_Go_To_Sleep(void)
 119             {
 120   1         PCON |= 0x01;    // Enter idle mode (generic 8051 version)
 121   1         }
 122          
 123          /*------------------------------------------------------------------*-
 124            ---- END OF FILE -------------------------------------------------
 125          -*------------------------------------------------------------------*/


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    123    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       4
   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 + -