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

📄 os_cpu_c.lst

📁 UCOS-II.ZIP UCOS-II.ZIP UCOS-II.ZIP
💻 LST
📖 第 1 页 / 共 5 页
字号:
  53      =2  
  22      =1  #include    <ucos_ii.h>
   1      =2  /*
   2      =2  *********************************************************************************************************
   3      =2  *                                                uC/OS-II
   4      =2  *                                          The Real-Time Kernel
   5      =2  *
   6      =2  *                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
   7      =2  *                                           All Rights Reserved
   8      =2  *
   9      =2  *                                                  V2.00
  10      =2  *
  11      =2  * File : uCOS_II.H
  12      =2  * By   : Jean J. Labrosse
  13      =2  *********************************************************************************************************
  14      =2  */
  15      =2  
  16      =2  /*
  17      =2  *********************************************************************************************************
  18      =2  *                                             MISCELLANEOUS
  19      =2  *********************************************************************************************************
  20      =2  */
  21      =2  
  22      =2  #define  OS_VERSION              200   /* Version of uC/OS-II (Vx.yy multiplied by 100)                */
  23      =2  
  24      =2  #ifdef   OS_GLOBALS
           =2 #define  OS_EXT
           =2 #else
  27      =2  #define  OS_EXT  extern
  28      =2  #endif
  29      =2  
  30      =2  #define  OS_PRIO_SELF           0xFF   /* Indicate SELF priority                                       */
  31      =2  
  32      =2  #if      OS_TASK_STAT_EN
           =2 #define  OS_N_SYS_TASKS            2                    /* Number of system tasks                      */
           =2 #else
  35      =2  #define  OS_N_SYS_TASKS            1
  36      =2  #endif
  37      =2  
  38      =2  #define  OS_STAT_PRIO       (OS_LOWEST_PRIO - 1)        /* Statistic task priority                     */
  39      =2  #define  OS_IDLE_PRIO       (OS_LOWEST_PRIO)            /* IDLE      task priority                     */
  40      =2  
  41      =2  #define  OS_EVENT_TBL_SIZE ((OS_LOWEST_PRIO) / 8 + 1)   /* Size of event table                         */
  42      =2  #define  OS_RDY_TBL_SIZE   ((OS_LOWEST_PRIO) / 8 + 1)   /* Size of ready table                         */
  43      =2  
  44      =2  #define  OS_TASK_IDLE_ID       65535   /* I.D. numbers for Idle and Stat tasks                         */
  45      =2  #define  OS_TASK_STAT_ID       65534
  46      =2  
  47      =2                                         /* TASK STATUS (Bit definition for OSTCBStat)                   */
  48      =2  #define  OS_STAT_RDY            0x00   /* Ready to run                                                 */
  49      =2  #define  OS_STAT_SEM            0x01   /* Pending on semaphore                                         */
  50      =2  #define  OS_STAT_MBOX           0x02   /* Pending on mailbox                                           */
  51      =2  #define  OS_STAT_Q              0x04   /* Pending on queue                                             */
  52      =2  #define  OS_STAT_SUSPEND        0x08   /* Task is suspended                                            */
  53      =2  
C51 COMPILER V7.01  OS_CPU_C                                                               02/20/2003 17:21:50 PAGE 5   

  54      =2  #define  OS_EVENT_TYPE_MBOX        1
  55      =2  #define  OS_EVENT_TYPE_Q           2
  56      =2  #define  OS_EVENT_TYPE_SEM         3
  57      =2  
  58      =2                                         /* TASK OPTIONS (see OSTaskCreateExt())                         */
  59      =2  #define  OS_TASK_OPT_STK_CHK  0x0001   /* Enable stack checking for the task                           */
  60      =2  #define  OS_TASK_OPT_STK_CLR  0x0002   /* Clear the stack when the task is create                      */
  61      =2  #define  OS_TASK_OPT_SAVE_FP  0x0004   /* Save the contents of any floating-point registers            */
  62      =2  
  63      =2  
  64      =2  #ifndef  FALSE
  65      =2  #define  FALSE                     0
  66      =2  #endif
  67      =2  
  68      =2  #ifndef  TRUE
  69      =2  #define  TRUE                      1
  70      =2  #endif
  71      =2  
  72      =2  /*
  73      =2  *********************************************************************************************************
  74      =2  *                                              ERROR CODES
  75      =2  *********************************************************************************************************
  76      =2  */
  77      =2  
  78      =2  #define OS_NO_ERR                 0
  79      =2  #define OS_ERR_EVENT_TYPE         1
  80      =2  #define OS_ERR_PEND_ISR           2
  81      =2  
  82      =2  #define OS_TIMEOUT               10
  83      =2  #define OS_TASK_NOT_EXIST        11
  84      =2  
  85      =2  #define OS_MBOX_FULL             20
  86      =2  
  87      =2  #define OS_Q_FULL                30
  88      =2  
  89      =2  #define OS_PRIO_EXIST            40
  90      =2  #define OS_PRIO_ERR              41
  91      =2  #define OS_PRIO_INVALID          42
  92      =2  
  93      =2  #define OS_SEM_OVF               50
  94      =2  
  95      =2  #define OS_TASK_DEL_ERR          60
  96      =2  #define OS_TASK_DEL_IDLE         61
  97      =2  #define OS_TASK_DEL_REQ          62
  98      =2  #define OS_TASK_DEL_ISR          63
  99      =2  
 100      =2  #define OS_NO_MORE_TCB           70
 101      =2  
 102      =2  #define OS_TIME_NOT_DLY          80
 103      =2  #define OS_TIME_INVALID_MINUTES  81
 104      =2  #define OS_TIME_INVALID_SECONDS  82
 105      =2  #define OS_TIME_INVALID_MILLI    83
 106      =2  #define OS_TIME_ZERO_DLY         84
 107      =2  
 108      =2  #define OS_TASK_SUSPEND_PRIO     90
 109      =2  #define OS_TASK_SUSPEND_IDLE     91
 110      =2  
 111      =2  #define OS_TASK_RESUME_PRIO     100
 112      =2  #define OS_TASK_NOT_SUSPENDED   101
 113      =2  
 114      =2  #define OS_MEM_INVALID_PART     110
 115      =2  #define OS_MEM_INVALID_BLKS     111
C51 COMPILER V7.01  OS_CPU_C                                                               02/20/2003 17:21:50 PAGE 6   

 116      =2  #define OS_MEM_INVALID_SIZE     112
 117      =2  #define OS_MEM_NO_FREE_BLKS     113
 118      =2  #define OS_MEM_FULL             114
 119      =2  
 120      =2  #define OS_TASK_OPT_ERR         130
 121      =2  
 122      =2  /*$PAGE*/
 123      =2  /*
 124      =2  *********************************************************************************************************
 125      =2  *                                          EVENT CONTROL BLOCK
 126      =2  *********************************************************************************************************
 127      =2  */
 128      =2  
 129      =2  #if (OS_MAX_EVENTS >= 2)
 130      =2  typedef struct {
 131      =2      void   *OSEventPtr;                    /* Pointer to message or queue structure                    */
 132      =2      INT8U   OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur                 */
 133      =2      INT16U  OSEventCnt;                    /* Count of used when event is a semaphore                  */
 134      =2      INT8U   OSEventType;                   /* OS_EVENT_TYPE_MBOX, OS_EVENT_TYPE_Q or OS_EVENT_TYPE_SEM */
 135      =2      INT8U   OSEventGrp;                    /* Group corresponding to tasks waiting for event to occur  */
 136      =2  } OS_EVENT;
 137      =2  #endif
 138      =2  
 139      =2  /*$PAGE*/
 140      =2  /*
 141      =2  *********************************************************************************************************
 142      =2  *                                          MESSAGE MAILBOX DATA
 143      =2  *********************************************************************************************************
 144      =2  */
 145      =2  
 146      =2  #if OS_MBOX_EN
           =2 typedef struct {
           =2     void   *OSMsg;                         /* Pointer to message in mailbox                            */
           =2     INT8U   OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur                 */
           =2     INT8U   OSEventGrp;                    /* Group corresponding to tasks waiting for event to occur  */
           =2 } OS_MBOX_DATA;
           =2 #endif
 153      =2  
 154      =2  /*
 155      =2  *********************************************************************************************************
 156      =2  *                                     MEMORY PARTITION DATA STRUCTURES
 157      =2  *********************************************************************************************************
 158      =2  */
 159      =2  
 160      =2  #if OS_MEM_EN && (OS_MAX_MEM_PART >= 2)
           =2 typedef struct {                       /* MEMORY CONTROL BLOCK                                         */
           =2     void   *OSMemAddr;                 /* Pointer to beginning of memory partition                     */
           =2     void   *OSMemFreeList;             /* Pointer to list of free memory blocks                        */
           =2     INT32U  OSMemBlkSize;              /* Size (in bytes) of each block of memory                      */
           =2     INT32U  OSMemNBlks;                /* Total number of blocks in this partition                     */
           =2     INT32U  OSMemNFree;                /* Number of memory blocks remaining in this partition          */
           =2 } OS_MEM;
           =2 
           =2 
           =2 typedef struct {
           =2     void   *OSAddr;                    /* Pointer to the beginning address of the memory partition     */
           =2     void   *OSFreeList;                /* Pointer to the beginning of the free list of memory blocks   */
           =2     INT32U  OSBlkSize;                 /* Size (in bytes) of each memory block                         */
           =2     INT32U  OSNBlks;                   /* Total number of blocks in the partition                      */
           =2     INT32U  OSNFree;                   /* Number of memory blocks free                                 */
           =2     INT32U  OSNUsed;                   /* Number of memory blocks used                                 */
           =2 } OS_MEM_DATA;
C51 COMPILER V7.01  OS_CPU_C                                                               02/20/2003 17:21:50 PAGE 7   

           =2 #endif
 179      =2  
 180      =2  /*$PAGE*/
 181      =2  /*
 182      =2  *********************************************************************************************************
 183      =2  *                                          MESSAGE QUEUE DATA
 184      =2  *********************************************************************************************************
 185      =2  */
 186      =2  
 187      =2  #if OS_Q_EN
           =2 typedef struct {
           =2     void   *OSMsg;                          /* Pointer to next message to be extracted from queue      */
           =2     INT16U  OSNMsgs;                        /* Number of messages in message queue                     */
           =2     INT16U  OSQSize;                        /* Size of message queue                                   */
           =2     INT8U   OSEventTbl[OS_EVENT_TBL_SIZE];  /* List of tasks waiting for event to occur                */
           =2     INT8U   OSEventGrp;                     /* Group corresponding to tasks waiting for event to occur */

⌨️ 快捷键说明

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