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

📄 eventtable.lst

📁 单片机程序代码,经过很详细的测试.呵呵,硬件相关.
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.50   EVENTTABLE                                                            03/10/2006 16:35:24 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE EVENTTABLE
OBJECT MODULE PLACED IN eventtable.OBJ
COMPILER INVOKED BY: e:\Keil\C51\BIN\C51.EXE eventtable.c LARGE OPTIMIZE(9,SIZE) BROWSE NOAREGS DEBUG OBJECTEXTEND

line level    source

   1          
   2          #ifndef _variable_c_
   3          #define _variable_c_
   4          
   5          #define TabLength 8
   6          /*
   7          ********************************************************************************************************
   8          * prio : unsigned char 
   9          * ResRdyGrp : unsigned char 
  10          * ResRdyTbl[] : unsigned char 
  11          * note: 
  12          *       Every bit in ResRdyGrp is used to indicate whenever any Response in a group is ready to execute.
  13          *       When any response is ready to execute,it sets the corresponding bit in the ResRdyTbl[].   
  14          *       prio : the prio is the index of the respones event .
  15          *********************************************************************************************************
  16          */
  17          //unsigned char xdata prio=0;
  18          unsigned char xdata ResRdyGrp=0;
  19          unsigned char xdata ResRdyTbl[TabLength]={0,0,0,0,0,0,0,0};
  20          /*
  21          *********************************************************************************************************
  22          * McpRdyGrp : unsigned char
  23          * McpRdyTbl[] : unsigned char
  24          * note :
  25          *       Every bit in McpRdyGrp is used to indicate whenever any MCP event in a group is ready to execute.
  26                  When any MCP event is ready to execute,it sets the corresponding bit in the McpRdyTbl[].
  27                  When any MCP event has been executed,it clear the corresponding bit in the McpRdyTbl[].
  28                  if any MCP event have been executed,it also clear the corresponding bit in the McpRdyGrp.
  29          *********************************************************************************************************
  30          */
  31          
  32          unsigned char xdata McpRdyGrp=0;
  33          unsigned char xdata McpRdyTbl[TabLength]={0,0,0,0,0,0,0,0};
  34          
  35          /*
  36          *********************************************************************************************************
  37          * ExtRdyGrp : unsigned char
  38          * ExtRdyTbl[] : unsigend char
  39          * note :
  40          *       Every bit in ExtRdyGrp is used to indicate whenever any EXT interrupt event in a group is ready to execu
             -te.
  41                  When any EXT interrupt event is ready to execute,it sets the corresponding bit in the ExtRdyTbl[].
  42                  When any EXT interrupt event has been executed,it clear the correspoinding bit in th ExtRdytbl[].
  43                  if any EXT interrupt event have been executed,it also clear the conrresponding bit in the ExtRdyGrp.
  44          * EXT interrupt:
  45                  Microchip INT0
  46                  Microchip INT1
  47                  Microchip Timing 
  48          ********************************************************************************************************
  49          */
  50          
  51          unsigned char xdata ExtRdyGrp=0;
  52          unsigned char xdata ExtRdyTbl[TabLength]={0,0,0,0,0,0,0,0};
  53          
  54          
C51 COMPILER V7.50   EVENTTABLE                                                            03/10/2006 16:35:24 PAGE 2   

  55          /*
  56          *********************************************************************************************************
  57          *                              MAPPING TABLE TO MAP BIT POSITION TO BIT MASK
  58          *
  59          * Note: Index into table is desired bit position, 0..7
  60          *       Indexed value corresponds to bit mask
  61          *********************************************************************************************************
  62          */
  63          
  64          unsigned char const code OSMapTbl[]   = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
  65          
  66          /*
  67          *********************************************************************************************************
  68          *                                       PRIORITY RESOLUTION TABLE
  69          *
  70          * Note: Index into table is bit pattern to resolve highest priority
  71          *       Indexed value corresponds to highest priority bit position (i.e. 0..7)
  72          *********************************************************************************************************
  73          */
  74          
  75          unsigned char const code OSUnMapTbl[] = {
  76              0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  77              4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  78              5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  79              4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  80              6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  81              4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  82              5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  83              4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  84              7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  85              4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  86              5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  87              4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  88              6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  89              4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  90              5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  91              4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
  92          };
  93          
  94          /****************************************************/
  95          /*                      ScanResRdyTbl()
  96          *       Description :   scan the ResRdyTbl[] and find the response readying to execute. 
  97          *       Arguments :     none
  98          *       return  :       prio    is the index should be executed next.
  99          */
 100          /****************************************************/
 101          unsigned char ScanResRdyTbl() {
 102   1              unsigned char xdata x = 0;
 103   1              unsigned char xdata y = 0;
 104   1              y=OSUnMapTbl[ResRdyGrp];
 105   1              x=OSUnMapTbl[ResRdyTbl[y]];
 106   1              return ((y << 3) + x);  
 107   1      }
 108          /***************************************************/
 109          /*                      SetResRdyTbl()
 110          *       Description :   set the ResRdyTbl[] bit corresponding to prio,indicate the response event has happened.
 111          *       Arguments :     prio    is the index of the event that just happened.
 112          *       return  :       none
 113          */
 114          /**************************************************/
 115          void SetResRdyTbl(volatile unsigned char prio) large reentrant {
 116   1              ResRdyGrp |= OSMapTbl[prio >> 3];
C51 COMPILER V7.50   EVENTTABLE                                                            03/10/2006 16:35:24 PAGE 3   

 117   1              ResRdyTbl[prio >> 3] |= OSMapTbl[prio & 0x7];
 118   1      }
 119          
 120          /**************************************************/
 121          /*                      ClearResRdyTbl()
 122          *       Description :   clear the ResRdyTbl[] bit corresponding to prio,indicate the response event has executed.
 123          *       Arguments :     prio    is the index of the event that just executed.
 124          *       Return  :       none
 125          */
 126          /**************************************************/
 127          void ClearResRdyTbl(volatile unsigned char prio){
 128   1              if((ResRdyTbl[prio >> 3] &= ~OSMapTbl[prio & 0x7]) == 0)
 129   1                      ResRdyGrp &= ~OSMapTbl[prio >> 3];
 130   1      }
 131          
 132          /**************************************************/
 133          /*                      GetResRdyTbl()
 134          *       Description :   get the state of McpResTbl[] bit corresponding to prio

⌨️ 快捷键说明

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