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

📄 eventtable.lst

📁 单片机程序代码,经过很详细的测试.呵呵,硬件相关.
💻 LST
📖 第 1 页 / 共 2 页
字号:
 135          *       Arguments :     prio    is the index of the event that just executed.
 136          *       Return  :       true 1 ,faulse 0
 137          */
 138          /**************************************************/
 139          unsigned char GetResRdyTbl(volatile unsigned char prio) large reentrant{
 140   1              unsigned char xdata temp1,temp2;
 141   1              temp1 = ResRdyGrp & OSMapTbl[prio >> 3];
 142   1              temp2 = ResRdyTbl[prio >> 3] & OSMapTbl[prio & 0x7];
 143   1      //      if ((ResRdyGrp && OSMapTbl[prio >> 3]) && (ResRdyTbl[prio >> 3] && OSMapTbl[prio & 0x7]))
 144   1              if (temp1 && temp2)
 145   1                      return 1;
 146   1              else
 147   1                      return 0;
 148   1      }
 149          
 150          /**************************************************/
 151          /*                      ScanMcpRdyTbl()
 152          *       Description :   scan the McpRdyTbl[] and find the MCP event  readying to execute. 
 153          *       Arguments :     none
 154          *       return  :       prio    is the index should be executed next.
 155          */
 156          /****************************************************/
 157          unsigned char ScanMcpRdyTbl() {
 158   1              unsigned char xdata x = 0;
 159   1              unsigned char xdata y = 0;
 160   1              y=OSUnMapTbl[McpRdyGrp];
 161   1              x=OSUnMapTbl[McpRdyTbl[y]];
 162   1              return ((y << 3) + x);  
 163   1      }
 164          /***************************************************/
 165          /*                      SetMcpRdyTbl()
 166          *       Description :   set the McpRdyTbl[] bit corresponding to prio,indicate the MCP event has happened.
 167          *       Arguments :     prio    is the index of the event that just happened.
 168          *       return  :       none
 169          */
 170          /**************************************************/
 171          void SetMcpRdyTbl(volatile unsigned char prio) {
 172   1              McpRdyGrp |= OSMapTbl[prio >> 3];
 173   1              McpRdyTbl[prio >> 3] |= OSMapTbl[prio & 0x7];
 174   1      }
 175          
 176          /**************************************************/
 177          /*                      ClearMcpRdyTbl()
 178          *       Description :   clear the McpRdyTbl[] bit corresponding to prio,indicate the MCP event has executed.
C51 COMPILER V7.50   EVENTTABLE                                                            03/10/2006 16:35:24 PAGE 4   

 179          *       Arguments :     prio    is the index of the event that just executed.
 180          *       Return  :       none
 181          */
 182          /**************************************************/
 183          void ClearMcpRdyTbl(volatile unsigned char prio){
 184   1              if((McpRdyTbl[prio >> 3] &= ~OSMapTbl[prio & 0x7]) == 0)
 185   1                      McpRdyGrp &= ~OSMapTbl[prio >> 3];
 186   1      }
 187          
 188          /**************************************************/
 189          /*                      GetMcpRdyTbl()
 190          *       Description :   get the state of McpRdyTbl[] bit corresponding to prio
 191          *       Arguments :     prio    is the index of the event that just executed.
 192          *       Return  :       true 1 ,faulse 0
 193          */
 194          /**************************************************/
 195          unsigned char GetMcpRdyTbl(volatile unsigned char prio){
 196   1              unsigned char xdata temp1,temp2;
 197   1              temp1 = McpRdyGrp & OSMapTbl[prio >> 3];
 198   1              temp2 = McpRdyTbl[prio >> 3] & OSMapTbl[prio & 0x7];
 199   1              if (temp1 && temp2)
 200   1      //      if ((McpRdyGrp && OSMapTbl[prio >> 3]) && (McpRdyTbl[prio >> 3] && OSMapTbl[prio & 0x7]))
 201   1                      return 1;
 202   1              else
 203   1                      return 0;
 204   1      }
 205          
 206          /****************************************************/
 207          /*                      ScanExtRdyTbl()
 208          *       Description :   scan the ExtRdyTbl[] and find the Interrupt event readying to execute. 
 209          *       Arguments :     none
 210          *       return  :       prio    is the index should be executed next.
 211          */
 212          /****************************************************/
 213          unsigned char ScanExtRdyTbl() {
 214   1              unsigned char xdata x = 0;
 215   1              unsigned char xdata y = 0;
 216   1              y=OSUnMapTbl[ExtRdyGrp];
 217   1              x=OSUnMapTbl[ExtRdyTbl[y]];
 218   1              return ((y << 3) + x);  
 219   1      }
 220          /***************************************************/
 221          /*                      SetExtRdyTbl()
 222          *       Description :   set the ExtRdyTbl[] bit corresponding to prio,indicate the INT event has happened.
 223          *       Arguments :     prio    is the index of the event that just happened.
 224          *       return  :       none
 225          */
 226          /**************************************************/
 227          void SetExtRdyTbl(volatile unsigned char prio) large reentrant {
 228   1              ExtRdyGrp |= OSMapTbl[prio >> 3];
 229   1              ExtRdyTbl[prio >> 3] |= OSMapTbl[prio & 0x7];
 230   1      }
 231          
 232          /**************************************************/
 233          /*                      ClearExtRdyTbl()
 234          *       Description :   clear the ExtRdyTbl[] bit corresponding to prio,indicate the INT event has executed.
 235          *       Arguments :     prio    is the index of the event that just executed.
 236          *       Return  :       none
 237          */
 238          /**************************************************/
 239          void ClearExtRdyTbl(volatile unsigned char prio){
 240   1              if((ExtRdyTbl[prio >> 3] &= ~OSMapTbl[prio & 0x7]) == 0)
C51 COMPILER V7.50   EVENTTABLE                                                            03/10/2006 16:35:24 PAGE 5   

 241   1                      ExtRdyGrp &= ~OSMapTbl[prio >> 3];
 242   1      }
 243          
 244          /**************************************************/
 245          /*                      GetExtRdyTbl()
 246          *       Description :   get the state of McpExtTbl[] bit corresponding to prio
 247          *       Arguments :     prio    is the index of the event that just executed.
 248          *       Return  :       true 1 ,faulse 0
 249          */
 250          /**************************************************
 251          unsigned char GetExtRdyTbl(volatile unsigned char prio){
 252                  unsigned char xdata temp1,temp2;
 253                  temp1 = ExtRdyGrp & OSMapTbl[prio >> 3];
 254                  temp2 = ExtRdyTbl[prio >> 3] & OSMapTbl[prio & 0x7];
 255                  if (temp1 && temp2)
 256          //      if ((ExtRdyGrp && OSMapTbl[prio >> 3]) && (ExtRdyTbl[prio >> 3] && OSMapTbl[prio & 0x7]))
 257                          return 1;
 258                  else
 259                          return 0;
 260          }
 261          */
 262          #endif  


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    601    ----
   CONSTANT SIZE    =    264    ----
   XDATA SIZE       =     27       5
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   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 + -