PageRenderTime 122ms CodeModel.GetById 60ms app.highlight 54ms RepoModel.GetById 1ms app.codeStats 0ms

/src/compiler/ucos-vs2008/UCOS_SIM/src/ucosii/ucos_ii.h

http://ftk.googlecode.com/
C++ Header | 1404 lines | 848 code | 298 blank | 258 comment | 34 complexity | 94011d4a119ffbe1da59083a2bc9bcec MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1/*
   2*********************************************************************************************************
   3*                                                uC/OS-II
   4*                                          The Real-Time Kernel
   5*
   6*                          (c) Copyright 1992-2005, Jean J. Labrosse, Weston, FL
   7*                                           All Rights Reserved
   8*
   9* File    : uCOS_II.H
  10* By      : Jean J. Labrosse
  11* Version : V2.80
  12*********************************************************************************************************
  13*/
  14
  15#ifndef   OS_uCOS_II_H
  16#define   OS_uCOS_II_H
  17
  18/*
  19*********************************************************************************************************
  20*                                          uC/OS-II VERSION NUMBER
  21*********************************************************************************************************
  22*/
  23
  24#define  OS_VERSION                 280u                /* Version of uC/OS-II (Vx.yy mult. by 100)    */
  25
  26/*
  27*********************************************************************************************************
  28*                                           INCLUDE HEADER FILES
  29*********************************************************************************************************
  30*/
  31
  32#include  <os_cpu.h>
  33#include  <os_cfg.h>
  34
  35#ifdef __cplusplus
  36extern "C" {
  37#endif
  38
  39/*
  40*********************************************************************************************************
  41*                                             MISCELLANEOUS
  42*********************************************************************************************************
  43*/
  44
  45#ifdef   OS_GLOBALS
  46#define  OS_EXT
  47#else
  48#define  OS_EXT  extern
  49#endif
  50
  51#ifndef  FALSE
  52#define  FALSE                        0u
  53#endif
  54
  55#ifndef  TRUE
  56#define  TRUE                         1u
  57#endif
  58
  59#define  OS_ASCII_NUL          (INT8U)0
  60
  61#define  OS_PRIO_SELF              0xFFu                /* Indicate SELF priority                      */
  62
  63#if OS_TASK_STAT_EN > 0
  64#define  OS_N_SYS_TASKS               2u                /* Number of system tasks                      */
  65#else
  66#define  OS_N_SYS_TASKS               1u
  67#endif
  68
  69#define  OS_STAT_PRIO       (OS_LOWEST_PRIO - 1)        /* Statistic task priority                     */
  70#define  OS_IDLE_PRIO       (OS_LOWEST_PRIO)            /* IDLE      task priority                     */
  71
  72#if OS_LOWEST_PRIO <= 63
  73#define  OS_EVENT_TBL_SIZE ((OS_LOWEST_PRIO) / 8 + 1)   /* Size of event table                         */
  74#define  OS_RDY_TBL_SIZE   ((OS_LOWEST_PRIO) / 8 + 1)   /* Size of ready table                         */
  75#else
  76#define  OS_EVENT_TBL_SIZE ((OS_LOWEST_PRIO) / 16 + 1)  /* Size of event table                         */
  77#define  OS_RDY_TBL_SIZE   ((OS_LOWEST_PRIO) / 16 + 1)  /* Size of ready table                         */
  78#endif
  79
  80#define  OS_TASK_IDLE_ID          65535u                /* I.D. numbers for Idle and Stat tasks        */
  81#define  OS_TASK_STAT_ID          65534u
  82
  83#define  OS_EVENT_EN       (((OS_Q_EN > 0) && (OS_MAX_QS > 0)) || (OS_MBOX_EN > 0) || (OS_SEM_EN > 0) || (OS_MUTEX_EN > 0))
  84
  85/*$PAGE*/
  86/*
  87*********************************************************************************************************
  88*                              TASK STATUS (Bit definition for OSTCBStat)
  89*********************************************************************************************************
  90*/
  91#define  OS_STAT_RDY               0x00u    /* Ready to run                                            */
  92#define  OS_STAT_SEM               0x01u    /* Pending on semaphore                                    */
  93#define  OS_STAT_MBOX              0x02u    /* Pending on mailbox                                      */
  94#define  OS_STAT_Q                 0x04u    /* Pending on queue                                        */
  95#define  OS_STAT_SUSPEND           0x08u    /* Task is suspended                                       */
  96#define  OS_STAT_MUTEX             0x10u    /* Pending on mutual exclusion semaphore                   */
  97#define  OS_STAT_FLAG              0x20u    /* Pending on event flag group                             */
  98
  99#define  OS_STAT_PEND_ANY         (OS_STAT_SEM | OS_STAT_MBOX | OS_STAT_Q | OS_STAT_MUTEX | OS_STAT_FLAG)
 100
 101/*
 102*********************************************************************************************************
 103*                                        OS_EVENT types
 104*********************************************************************************************************
 105*/
 106#define  OS_EVENT_TYPE_UNUSED         0u
 107#define  OS_EVENT_TYPE_MBOX           1u
 108#define  OS_EVENT_TYPE_Q              2u
 109#define  OS_EVENT_TYPE_SEM            3u
 110#define  OS_EVENT_TYPE_MUTEX          4u
 111#define  OS_EVENT_TYPE_FLAG           5u
 112
 113/*
 114*********************************************************************************************************
 115*                                         EVENT FLAGS
 116*********************************************************************************************************
 117*/
 118#define  OS_FLAG_WAIT_CLR_ALL         0u    /* Wait for ALL    the bits specified to be CLR (i.e. 0)   */
 119#define  OS_FLAG_WAIT_CLR_AND         0u
 120
 121#define  OS_FLAG_WAIT_CLR_ANY         1u    /* Wait for ANY of the bits specified to be CLR (i.e. 0)   */
 122#define  OS_FLAG_WAIT_CLR_OR          1u
 123
 124#define  OS_FLAG_WAIT_SET_ALL         2u    /* Wait for ALL    the bits specified to be SET (i.e. 1)   */
 125#define  OS_FLAG_WAIT_SET_AND         2u
 126
 127#define  OS_FLAG_WAIT_SET_ANY         3u    /* Wait for ANY of the bits specified to be SET (i.e. 1)   */
 128#define  OS_FLAG_WAIT_SET_OR          3u
 129
 130
 131#define  OS_FLAG_CONSUME           0x80u    /* Consume the flags if condition(s) satisfied             */
 132
 133
 134#define  OS_FLAG_CLR                  0u
 135#define  OS_FLAG_SET                  1u
 136
 137/*
 138*********************************************************************************************************
 139*                                   Values for OSTickStepState
 140*
 141* Note(s): This feature is used by uC/OS-View.
 142*********************************************************************************************************
 143*/
 144
 145#if OS_TICK_STEP_EN > 0
 146#define  OS_TICK_STEP_DIS             0u    /* Stepping is disabled, tick runs as mormal               */
 147#define  OS_TICK_STEP_WAIT            1u    /* Waiting for uC/OS-View to set OSTickStepState to _ONCE  */
 148#define  OS_TICK_STEP_ONCE            2u    /* Process tick once and wait for next cmd from uC/OS-View */
 149#endif
 150
 151/*
 152*********************************************************************************************************
 153*       Possible values for 'opt' argument of OSSemDel(), OSMboxDel(), OSQDel() and OSMutexDel()
 154*********************************************************************************************************
 155*/
 156#define  OS_DEL_NO_PEND               0u
 157#define  OS_DEL_ALWAYS                1u
 158
 159/*
 160*********************************************************************************************************
 161*                                     OS???PostOpt() OPTIONS
 162*
 163* These #defines are used to establish the options for OSMboxPostOpt() and OSQPostOpt().
 164*********************************************************************************************************
 165*/
 166#define  OS_POST_OPT_NONE          0x00u    /* NO option selected                                      */
 167#define  OS_POST_OPT_BROADCAST     0x01u    /* Broadcast message to ALL tasks waiting                  */
 168#define  OS_POST_OPT_FRONT         0x02u    /* Post to highest priority task waiting                   */
 169
 170/*
 171*********************************************************************************************************
 172*                                 TASK OPTIONS (see OSTaskCreateExt())
 173*********************************************************************************************************
 174*/
 175#define  OS_TASK_OPT_NONE        0x0000u    /* NO option selected                                      */
 176#define  OS_TASK_OPT_STK_CHK     0x0001u    /* Enable stack checking for the task                      */
 177#define  OS_TASK_OPT_STK_CLR     0x0002u    /* Clear the stack when the task is create                 */
 178#define  OS_TASK_OPT_SAVE_FP     0x0004u    /* Save the contents of any floating-point registers       */
 179
 180/*
 181*********************************************************************************************************
 182*                                             ERROR CODES
 183*********************************************************************************************************
 184*/
 185#define OS_NO_ERR                     0u
 186
 187#define OS_ERR_EVENT_TYPE             1u
 188#define OS_ERR_PEND_ISR               2u
 189#define OS_ERR_POST_NULL_PTR          3u
 190#define OS_ERR_PEVENT_NULL            4u
 191#define OS_ERR_POST_ISR               5u
 192#define OS_ERR_QUERY_ISR              6u
 193#define OS_ERR_INVALID_OPT            7u
 194#define OS_ERR_TASK_WAITING           8u
 195#define OS_ERR_PDATA_NULL             9u
 196
 197#define OS_TIMEOUT                   10u
 198#define OS_TASK_NOT_EXIST            11u
 199#define OS_ERR_EVENT_NAME_TOO_LONG   12u
 200#define OS_ERR_FLAG_NAME_TOO_LONG    13u
 201#define OS_ERR_TASK_NAME_TOO_LONG    14u
 202#define OS_ERR_PNAME_NULL            15u
 203#define OS_ERR_TASK_CREATE_ISR       16u
 204
 205#define OS_MBOX_FULL                 20u
 206
 207#define OS_Q_FULL                    30u
 208#define OS_Q_EMPTY                   31u
 209
 210#define OS_PRIO_EXIST                40u
 211#define OS_PRIO_ERR                  41u
 212#define OS_PRIO_INVALID              42u
 213
 214#define OS_SEM_OVF                   50u
 215
 216#define OS_TASK_DEL_ERR              60u
 217#define OS_TASK_DEL_IDLE             61u
 218#define OS_TASK_DEL_REQ              62u
 219#define OS_TASK_DEL_ISR              63u
 220
 221#define OS_NO_MORE_TCB               70u
 222
 223#define OS_TIME_NOT_DLY              80u
 224#define OS_TIME_INVALID_MINUTES      81u
 225#define OS_TIME_INVALID_SECONDS      82u
 226#define OS_TIME_INVALID_MILLI        83u
 227#define OS_TIME_ZERO_DLY             84u
 228
 229#define OS_TASK_SUSPEND_PRIO         90u
 230#define OS_TASK_SUSPEND_IDLE         91u
 231
 232#define OS_TASK_RESUME_PRIO         100u
 233#define OS_TASK_NOT_SUSPENDED       101u
 234
 235#define OS_MEM_INVALID_PART         110u
 236#define OS_MEM_INVALID_BLKS         111u
 237#define OS_MEM_INVALID_SIZE         112u
 238#define OS_MEM_NO_FREE_BLKS         113u
 239#define OS_MEM_FULL                 114u
 240#define OS_MEM_INVALID_PBLK         115u
 241#define OS_MEM_INVALID_PMEM         116u
 242#define OS_MEM_INVALID_PDATA        117u
 243#define OS_MEM_INVALID_ADDR         118u
 244#define OS_MEM_NAME_TOO_LONG        119u
 245
 246#define OS_ERR_NOT_MUTEX_OWNER      120u
 247
 248#define OS_TASK_OPT_ERR             130u
 249
 250#define OS_ERR_DEL_ISR              140u
 251#define OS_ERR_CREATE_ISR           141u
 252
 253#define OS_FLAG_INVALID_PGRP        150u
 254#define OS_FLAG_ERR_WAIT_TYPE       151u
 255#define OS_FLAG_ERR_NOT_RDY         152u
 256#define OS_FLAG_INVALID_OPT         153u
 257#define OS_FLAG_GRP_DEPLETED        154u
 258
 259#define OS_ERR_PIP_LOWER            160u
 260
 261/*$PAGE*/
 262/*
 263*********************************************************************************************************
 264*                                          EVENT CONTROL BLOCK
 265*********************************************************************************************************
 266*/
 267
 268#if OS_EVENT_EN && (OS_MAX_EVENTS > 0)
 269typedef struct os_event {
 270    INT8U    OSEventType;                    /* Type of event control block (see OS_EVENT_TYPE_xxxx)    */
 271    void    *OSEventPtr;                     /* Pointer to message or queue structure                   */
 272    INT16U   OSEventCnt;                     /* Semaphore Count (not used if other EVENT type)          */
 273#if OS_LOWEST_PRIO <= 63
 274    INT8U    OSEventGrp;                     /* Group corresponding to tasks waiting for event to occur */
 275    INT8U    OSEventTbl[OS_EVENT_TBL_SIZE];  /* List of tasks waiting for event to occur                */
 276#else
 277    INT16U   OSEventGrp;                     /* Group corresponding to tasks waiting for event to occur */
 278    INT16U   OSEventTbl[OS_EVENT_TBL_SIZE];  /* List of tasks waiting for event to occur                */
 279#endif
 280
 281#if OS_EVENT_NAME_SIZE > 1
 282    INT8U    OSEventName[OS_EVENT_NAME_SIZE];
 283#endif
 284} OS_EVENT;
 285#endif
 286
 287
 288/*
 289*********************************************************************************************************
 290*                                       EVENT FLAGS CONTROL BLOCK
 291*********************************************************************************************************
 292*/
 293
 294#if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
 295
 296#if OS_FLAGS_NBITS == 8                     /* Determine the size of OS_FLAGS (8, 16 or 32 bits)       */
 297typedef  INT8U    OS_FLAGS;
 298#endif
 299
 300#if OS_FLAGS_NBITS == 16
 301typedef  INT16U   OS_FLAGS;
 302#endif
 303
 304#if OS_FLAGS_NBITS == 32
 305typedef  INT32U   OS_FLAGS;
 306#endif
 307
 308
 309typedef struct os_flag_grp {                /* Event Flag Group                                        */
 310    INT8U         OSFlagType;               /* Should be set to OS_EVENT_TYPE_FLAG                     */
 311    void         *OSFlagWaitList;           /* Pointer to first NODE of task waiting on event flag     */
 312    OS_FLAGS      OSFlagFlags;              /* 8, 16 or 32 bit flags                                   */
 313#if OS_FLAG_NAME_SIZE > 1
 314    INT8U         OSFlagName[OS_FLAG_NAME_SIZE];
 315#endif
 316} OS_FLAG_GRP;
 317
 318
 319
 320typedef struct os_flag_node {               /* Event Flag Wait List Node                               */
 321    void         *OSFlagNodeNext;           /* Pointer to next     NODE in wait list                   */
 322    void         *OSFlagNodePrev;           /* Pointer to previous NODE in wait list                   */
 323    void         *OSFlagNodeTCB;            /* Pointer to TCB of waiting task                          */
 324    void         *OSFlagNodeFlagGrp;        /* Pointer to Event Flag Group                             */
 325    OS_FLAGS      OSFlagNodeFlags;          /* Event flag to wait on                                   */
 326    INT8U         OSFlagNodeWaitType;       /* Type of wait:                                           */
 327                                            /*      OS_FLAG_WAIT_AND                                   */
 328                                            /*      OS_FLAG_WAIT_ALL                                   */
 329                                            /*      OS_FLAG_WAIT_OR                                    */
 330                                            /*      OS_FLAG_WAIT_ANY                                   */
 331} OS_FLAG_NODE;
 332#endif
 333
 334/*$PAGE*/
 335/*
 336*********************************************************************************************************
 337*                                          MESSAGE MAILBOX DATA
 338*********************************************************************************************************
 339*/
 340
 341#if OS_MBOX_EN > 0
 342typedef struct os_mbox_data {
 343    void   *OSMsg;                         /* Pointer to message in mailbox                            */
 344#if OS_LOWEST_PRIO <= 63
 345    INT8U   OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur                 */
 346    INT8U   OSEventGrp;                    /* Group corresponding to tasks waiting for event to occur  */
 347#else
 348    INT16U  OSEventTbl[OS_EVENT_TBL_SIZE]; /* List of tasks waiting for event to occur                 */
 349    INT16U  OSEventGrp;                    /* Group corresponding to tasks waiting for event to occur  */
 350#endif
 351} OS_MBOX_DATA;
 352#endif
 353
 354/*
 355*********************************************************************************************************
 356*                                     MEMORY PARTITION DATA STRUCTURES
 357*********************************************************************************************************
 358*/
 359
 360#if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
 361typedef struct os_mem {                   /* MEMORY CONTROL BLOCK                                      */
 362    void   *OSMemAddr;                    /* Pointer to beginning of memory partition                  */
 363    void   *OSMemFreeList;                /* Pointer to list of free memory blocks                     */
 364    INT32U  OSMemBlkSize;                 /* Size (in bytes) of each block of memory                   */
 365    INT32U  OSMemNBlks;                   /* Total number of blocks in this partition                  */
 366    INT32U  OSMemNFree;                   /* Number of memory blocks remaining in this partition       */
 367#if OS_MEM_NAME_SIZE > 1
 368    INT8U   OSMemName[OS_MEM_NAME_SIZE];  /* Memory partition name                                     */
 369#endif
 370} OS_MEM;
 371
 372
 373typedef struct os_mem_data {
 374    void   *OSAddr;                    /* Pointer to the beginning address of the memory partition     */
 375    void   *OSFreeList;                /* Pointer to the beginning of the free list of memory blocks   */
 376    INT32U  OSBlkSize;                 /* Size (in bytes) of each memory block                         */
 377    INT32U  OSNBlks;                   /* Total number of blocks in the partition                      */
 378    INT32U  OSNFree;                   /* Number of memory blocks free                                 */
 379    INT32U  OSNUsed;                   /* Number of memory blocks used                                 */
 380} OS_MEM_DATA;
 381#endif
 382
 383/*$PAGE*/
 384/*
 385*********************************************************************************************************
 386*                                    MUTUAL EXCLUSION SEMAPHORE DATA
 387*********************************************************************************************************
 388*/
 389
 390#if OS_MUTEX_EN > 0
 391typedef struct os_mutex_data {
 392#if OS_LOWEST_PRIO <= 63
 393    INT8U   OSEventTbl[OS_EVENT_TBL_SIZE];  /* List of tasks waiting for event to occur                */
 394    INT8U   OSEventGrp;                     /* Group corresponding to tasks waiting for event to occur */
 395#else
 396    INT16U  OSEventTbl[OS_EVENT_TBL_SIZE];  /* List of tasks waiting for event to occur                */
 397    INT16U  OSEventGrp;                     /* Group corresponding to tasks waiting for event to occur */
 398#endif
 399    INT8U   OSValue;                        /* Mutex value (0 = used, 1 = available)                   */
 400    INT8U   OSOwnerPrio;                    /* Mutex owner's task priority or 0xFF if no owner         */
 401    INT8U   OSMutexPIP;                     /* Priority Inheritance Priority or 0xFF if no owner       */
 402} OS_MUTEX_DATA;
 403#endif
 404
 405/*
 406*********************************************************************************************************
 407*                                          MESSAGE QUEUE DATA
 408*********************************************************************************************************
 409*/
 410
 411#if OS_Q_EN > 0
 412typedef struct os_q {                   /* QUEUE CONTROL BLOCK                                         */
 413    struct os_q   *OSQPtr;              /* Link to next queue control block in list of free blocks     */
 414    void         **OSQStart;            /* Pointer to start of queue data                              */
 415    void         **OSQEnd;              /* Pointer to end   of queue data                              */
 416    void         **OSQIn;               /* Pointer to where next message will be inserted  in   the Q  */
 417    void         **OSQOut;              /* Pointer to where next message will be extracted from the Q  */
 418    INT16U         OSQSize;             /* Size of queue (maximum number of entries)                   */
 419    INT16U         OSQEntries;          /* Current number of entries in the queue                      */
 420} OS_Q;
 421
 422
 423typedef struct os_q_data {
 424    void          *OSMsg;               /* Pointer to next message to be extracted from queue          */
 425    INT16U         OSNMsgs;             /* Number of messages in message queue                         */
 426    INT16U         OSQSize;             /* Size of message queue                                       */
 427#if OS_LOWEST_PRIO <= 63
 428    INT8U          OSEventTbl[OS_EVENT_TBL_SIZE];  /* List of tasks waiting for event to occur         */
 429    INT8U          OSEventGrp;          /* Group corresponding to tasks waiting for event to occur     */
 430#else
 431    INT16U         OSEventTbl[OS_EVENT_TBL_SIZE];  /* List of tasks waiting for event to occur         */
 432    INT16U         OSEventGrp;          /* Group corresponding to tasks waiting for event to occur     */
 433#endif
 434} OS_Q_DATA;
 435#endif
 436
 437/*
 438*********************************************************************************************************
 439*                                           SEMAPHORE DATA
 440*********************************************************************************************************
 441*/
 442
 443#if OS_SEM_EN > 0
 444typedef struct os_sem_data {
 445    INT16U  OSCnt;                          /* Semaphore count                                         */
 446#if OS_LOWEST_PRIO <= 63
 447    INT8U   OSEventTbl[OS_EVENT_TBL_SIZE];  /* List of tasks waiting for event to occur                */
 448    INT8U   OSEventGrp;                     /* Group corresponding to tasks waiting for event to occur */
 449#else
 450    INT16U  OSEventTbl[OS_EVENT_TBL_SIZE];  /* List of tasks waiting for event to occur                */
 451    INT16U  OSEventGrp;                     /* Group corresponding to tasks waiting for event to occur */
 452#endif
 453} OS_SEM_DATA;
 454#endif
 455
 456/*
 457*********************************************************************************************************
 458*                                            TASK STACK DATA
 459*********************************************************************************************************
 460*/
 461
 462#if OS_TASK_CREATE_EXT_EN > 0
 463typedef struct os_stk_data {
 464    INT32U  OSFree;                    /* Number of free bytes on the stack                            */
 465    INT32U  OSUsed;                    /* Number of bytes used on the stack                            */
 466} OS_STK_DATA;
 467#endif
 468
 469/*$PAGE*/
 470/*
 471*********************************************************************************************************
 472*                                          TASK CONTROL BLOCK
 473*********************************************************************************************************
 474*/
 475
 476typedef struct os_tcb {
 477    OS_STK          *OSTCBStkPtr;      /* Pointer to current top of stack                              */
 478
 479#if OS_TASK_CREATE_EXT_EN > 0
 480    void            *OSTCBExtPtr;      /* Pointer to user definable data for TCB extension             */
 481    OS_STK          *OSTCBStkBottom;   /* Pointer to bottom of stack                                   */
 482    INT32U           OSTCBStkSize;     /* Size of task stack (in number of stack elements)             */
 483    INT16U           OSTCBOpt;         /* Task options as passed by OSTaskCreateExt()                  */
 484    INT16U           OSTCBId;          /* Task ID (0..65535)                                           */
 485#endif
 486
 487    struct os_tcb   *OSTCBNext;        /* Pointer to next     TCB in the TCB list                      */
 488    struct os_tcb   *OSTCBPrev;        /* Pointer to previous TCB in the TCB list                      */
 489
 490#if OS_EVENT_EN
 491    OS_EVENT        *OSTCBEventPtr;    /* Pointer to event control block                               */
 492#endif
 493
 494#if ((OS_Q_EN > 0) && (OS_MAX_QS > 0)) || (OS_MBOX_EN > 0)
 495    void            *OSTCBMsg;         /* Message received from OSMboxPost() or OSQPost()              */
 496#endif
 497
 498#if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
 499#if OS_TASK_DEL_EN > 0
 500    OS_FLAG_NODE    *OSTCBFlagNode;    /* Pointer to event flag node                                   */
 501#endif
 502    OS_FLAGS         OSTCBFlagsRdy;    /* Event flags that made task ready to run                      */
 503#endif
 504
 505    INT16U           OSTCBDly;         /* Nbr ticks to delay task or, timeout waiting for event        */
 506    INT8U            OSTCBStat;        /* Task status                                                  */
 507    BOOLEAN          OSTCBPendTO;      /* Flag indicating PEND timed out (TRUE == timed out)           */
 508    INT8U            OSTCBPrio;        /* Task priority (0 == highest)                                 */
 509
 510    INT8U            OSTCBX;           /* Bit position in group  corresponding to task priority        */
 511    INT8U            OSTCBY;           /* Index into ready table corresponding to task priority        */
 512#if OS_LOWEST_PRIO <= 63
 513    INT8U            OSTCBBitX;        /* Bit mask to access bit position in ready table               */
 514    INT8U            OSTCBBitY;        /* Bit mask to access bit position in ready group               */
 515#else
 516    INT16U           OSTCBBitX;        /* Bit mask to access bit position in ready table               */
 517    INT16U           OSTCBBitY;        /* Bit mask to access bit position in ready group               */
 518#endif
 519
 520#if OS_TASK_DEL_EN > 0
 521    INT8U            OSTCBDelReq;      /* Indicates whether a task needs to delete itself              */
 522#endif
 523
 524#if OS_TASK_PROFILE_EN > 0
 525    INT32U           OSTCBCtxSwCtr;    /* Number of time the task was switched in                      */
 526    INT32U           OSTCBCyclesTot;   /* Total number of clock cycles the task has been running       */
 527    INT32U           OSTCBCyclesStart; /* Snapshot of cycle counter at start of task resumption        */
 528    OS_STK          *OSTCBStkBase;     /* Pointer to the beginning of the task stack                   */
 529    INT32U           OSTCBStkUsed;     /* Number of bytes used from the stack                          */
 530#endif
 531
 532#if OS_TASK_NAME_SIZE > 1
 533    INT8U            OSTCBTaskName[OS_TASK_NAME_SIZE];
 534#endif
 535} OS_TCB;
 536
 537/*$PAGE*/
 538/*
 539*********************************************************************************************************
 540*                                            GLOBAL VARIABLES
 541*********************************************************************************************************
 542*/
 543
 544OS_EXT  INT32U            OSCtxSwCtr;               /* Counter of number of context switches           */
 545
 546#if OS_EVENT_EN && (OS_MAX_EVENTS > 0)
 547OS_EXT  OS_EVENT         *OSEventFreeList;          /* Pointer to list of free EVENT control blocks    */
 548OS_EXT  OS_EVENT          OSEventTbl[OS_MAX_EVENTS];/* Table of EVENT control blocks                   */
 549#endif
 550
 551#if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
 552OS_EXT  OS_FLAG_GRP       OSFlagTbl[OS_MAX_FLAGS];  /* Table containing event flag groups              */
 553OS_EXT  OS_FLAG_GRP      *OSFlagFreeList;           /* Pointer to free list of event flag groups       */
 554#endif
 555
 556#if OS_TASK_STAT_EN > 0
 557OS_EXT  INT8S             OSCPUUsage;               /* Percentage of CPU used                          */
 558OS_EXT  INT32U            OSIdleCtrMax;             /* Max. value that idle ctr can take in 1 sec.     */
 559OS_EXT  INT32U            OSIdleCtrRun;             /* Val. reached by idle ctr at run time in 1 sec.  */
 560OS_EXT  BOOLEAN           OSStatRdy;                /* Flag indicating that the statistic task is rdy  */
 561OS_EXT  OS_STK            OSTaskStatStk[OS_TASK_STAT_STK_SIZE];      /* Statistics task stack          */
 562#endif
 563
 564OS_EXT  INT8U             OSIntNesting;             /* Interrupt nesting level                         */
 565
 566OS_EXT  INT8U             OSLockNesting;            /* Multitasking lock nesting level                 */
 567
 568OS_EXT  INT8U             OSPrioCur;                /* Priority of current task                        */
 569OS_EXT  INT8U             OSPrioHighRdy;            /* Priority of highest priority task               */
 570
 571#if OS_LOWEST_PRIO <= 63
 572OS_EXT  INT8U             OSRdyGrp;                        /* Ready list group                         */
 573OS_EXT  INT8U             OSRdyTbl[OS_RDY_TBL_SIZE];       /* Table of tasks which are ready to run    */
 574#else
 575OS_EXT  INT16U            OSRdyGrp;                        /* Ready list group                         */
 576OS_EXT  INT16U            OSRdyTbl[OS_RDY_TBL_SIZE];       /* Table of tasks which are ready to run    */
 577#endif
 578
 579OS_EXT  BOOLEAN           OSRunning;                       /* Flag indicating that kernel is running   */
 580
 581OS_EXT  INT8U             OSTaskCtr;                       /* Number of tasks created                  */
 582
 583OS_EXT  volatile  INT32U  OSIdleCtr;                                 /* Idle counter                   */
 584
 585OS_EXT  OS_STK            OSTaskIdleStk[OS_TASK_IDLE_STK_SIZE];      /* Idle task stack                */
 586
 587
 588OS_EXT  OS_TCB           *OSTCBCur;                        /* Pointer to currently running TCB         */
 589OS_EXT  OS_TCB           *OSTCBFreeList;                   /* Pointer to list of free TCBs             */
 590OS_EXT  OS_TCB           *OSTCBHighRdy;                    /* Pointer to highest priority TCB R-to-R   */
 591OS_EXT  OS_TCB           *OSTCBList;                       /* Pointer to doubly linked list of TCBs    */
 592OS_EXT  OS_TCB           *OSTCBPrioTbl[OS_LOWEST_PRIO + 1];/* Table of pointers to created TCBs        */
 593OS_EXT  OS_TCB            OSTCBTbl[OS_MAX_TASKS + OS_N_SYS_TASKS];   /* Table of TCBs                  */
 594
 595#if OS_TICK_STEP_EN > 0
 596OS_EXT  INT8U             OSTickStepState;          /* Indicates the state of the tick step feature    */
 597#endif
 598
 599#if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
 600OS_EXT  OS_MEM           *OSMemFreeList;            /* Pointer to free list of memory partitions       */
 601OS_EXT  OS_MEM            OSMemTbl[OS_MAX_MEM_PART];/* Storage for memory partition manager            */
 602#endif
 603
 604#if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
 605OS_EXT  OS_Q             *OSQFreeList;              /* Pointer to list of free QUEUE control blocks    */
 606OS_EXT  OS_Q              OSQTbl[OS_MAX_QS];        /* Table of QUEUE control blocks                   */
 607#endif
 608
 609#if OS_TIME_GET_SET_EN > 0
 610OS_EXT  volatile  INT32U  OSTime;                   /* Current value of system time (in ticks)         */
 611#endif
 612
 613
 614extern  INT8U   const     OSUnMapTbl[256];          /* Priority->Index    lookup table                 */
 615
 616/*$PAGE*/
 617/*
 618*********************************************************************************************************
 619*                                          FUNCTION PROTOTYPES
 620*                                     (Target Independent Functions)
 621*********************************************************************************************************
 622*/
 623
 624/*
 625*********************************************************************************************************
 626*                                            MISCELLANEOUS
 627*********************************************************************************************************
 628*/
 629
 630#if OS_EVENT_EN && (OS_EVENT_NAME_SIZE > 1)
 631INT8U         OSEventNameGet(OS_EVENT *pevent, INT8U *pname, INT8U *err);
 632void          OSEventNameSet(OS_EVENT *pevent, INT8U *pname, INT8U *err);
 633#endif
 634
 635/*
 636*********************************************************************************************************
 637*                                         EVENT FLAGS MANAGEMENT
 638*********************************************************************************************************
 639*/
 640
 641#if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
 642
 643#if OS_FLAG_ACCEPT_EN > 0
 644OS_FLAGS      OSFlagAccept(OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U wait_type, INT8U *err);
 645#endif
 646
 647OS_FLAG_GRP  *OSFlagCreate(OS_FLAGS flags, INT8U *err);
 648
 649#if OS_FLAG_DEL_EN > 0
 650OS_FLAG_GRP  *OSFlagDel(OS_FLAG_GRP *pgrp, INT8U opt, INT8U *err);
 651#endif
 652
 653#if (OS_FLAG_EN > 0) && (OS_FLAG_NAME_SIZE > 1)
 654INT8U         OSFlagNameGet(OS_FLAG_GRP *pgrp, INT8U *pname, INT8U *err);
 655void          OSFlagNameSet(OS_FLAG_GRP *pgrp, INT8U *pname, INT8U *err);
 656#endif
 657
 658OS_FLAGS      OSFlagPend(OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U wait_type, INT16U timeout, INT8U *err);
 659OS_FLAGS      OSFlagPendGetFlagsRdy(void);
 660OS_FLAGS      OSFlagPost(OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U opt, INT8U *err);
 661
 662#if OS_FLAG_QUERY_EN > 0
 663OS_FLAGS      OSFlagQuery(OS_FLAG_GRP *pgrp, INT8U *err);
 664#endif
 665#endif
 666
 667/*
 668*********************************************************************************************************
 669*                                        MESSAGE MAILBOX MANAGEMENT
 670*********************************************************************************************************
 671*/
 672
 673#if OS_MBOX_EN > 0
 674
 675#if OS_MBOX_ACCEPT_EN > 0
 676void         *OSMboxAccept(OS_EVENT *pevent);
 677#endif
 678
 679OS_EVENT     *OSMboxCreate(void *msg);
 680
 681#if OS_MBOX_DEL_EN > 0
 682OS_EVENT     *OSMboxDel(OS_EVENT *pevent, INT8U opt, INT8U *err);
 683#endif
 684
 685void         *OSMboxPend(OS_EVENT *pevent, INT16U timeout, INT8U *err);
 686
 687#if OS_MBOX_POST_EN > 0
 688INT8U         OSMboxPost(OS_EVENT *pevent, void *msg);
 689#endif
 690
 691#if OS_MBOX_POST_OPT_EN > 0
 692INT8U         OSMboxPostOpt(OS_EVENT *pevent, void *msg, INT8U opt);
 693#endif
 694
 695#if OS_MBOX_QUERY_EN > 0
 696INT8U         OSMboxQuery(OS_EVENT *pevent, OS_MBOX_DATA *p_mbox_data);
 697#endif
 698#endif
 699
 700/*
 701*********************************************************************************************************
 702*                                           MEMORY MANAGEMENT
 703*********************************************************************************************************
 704*/
 705
 706#if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
 707
 708OS_MEM       *OSMemCreate(void *addr, INT32U nblks, INT32U blksize, INT8U *err);
 709void         *OSMemGet(OS_MEM *pmem, INT8U *err);
 710#if OS_MEM_NAME_SIZE > 1
 711INT8U         OSMemNameGet(OS_MEM *pmem, INT8U *pname, INT8U *err);
 712void          OSMemNameSet(OS_MEM *pmem, INT8U *pname, INT8U *err);
 713#endif
 714INT8U         OSMemPut(OS_MEM *pmem, void *pblk);
 715
 716#if OS_MEM_QUERY_EN > 0
 717INT8U         OSMemQuery(OS_MEM *pmem, OS_MEM_DATA *p_mem_data);
 718#endif
 719
 720#endif
 721
 722/*
 723*********************************************************************************************************
 724*                                MUTUAL EXCLUSION SEMAPHORE MANAGEMENT
 725*********************************************************************************************************
 726*/
 727
 728#if OS_MUTEX_EN > 0
 729
 730#if OS_MUTEX_ACCEPT_EN > 0
 731INT8U         OSMutexAccept(OS_EVENT *pevent, INT8U *err);
 732#endif
 733
 734OS_EVENT     *OSMutexCreate(INT8U prio, INT8U *err);
 735
 736#if OS_MUTEX_DEL_EN > 0
 737OS_EVENT     *OSMutexDel(OS_EVENT *pevent, INT8U opt, INT8U *err);
 738#endif
 739
 740void          OSMutexPend(OS_EVENT *pevent, INT16U timeout, INT8U *err);
 741INT8U         OSMutexPost(OS_EVENT *pevent);
 742
 743#if OS_MUTEX_QUERY_EN > 0
 744INT8U         OSMutexQuery(OS_EVENT *pevent, OS_MUTEX_DATA *p_mutex_data);
 745#endif
 746
 747#endif
 748
 749/*$PAGE*/
 750/*
 751*********************************************************************************************************
 752*                                         MESSAGE QUEUE MANAGEMENT
 753*********************************************************************************************************
 754*/
 755
 756#if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
 757
 758#if OS_Q_ACCEPT_EN > 0
 759void         *OSQAccept(OS_EVENT *pevent, INT8U *err);
 760#endif
 761
 762OS_EVENT     *OSQCreate(void **start, INT16U size);
 763
 764#if OS_Q_DEL_EN > 0
 765OS_EVENT     *OSQDel(OS_EVENT *pevent, INT8U opt, INT8U *err);
 766#endif
 767
 768#if OS_Q_FLUSH_EN > 0
 769INT8U         OSQFlush(OS_EVENT *pevent);
 770#endif
 771
 772void         *OSQPend(OS_EVENT *pevent, INT16U timeout, INT8U *err);
 773
 774#if OS_Q_POST_EN > 0
 775INT8U         OSQPost(OS_EVENT *pevent, void *msg);
 776#endif
 777
 778#if OS_Q_POST_FRONT_EN > 0
 779INT8U         OSQPostFront(OS_EVENT *pevent, void *msg);
 780#endif
 781
 782#if OS_Q_POST_OPT_EN > 0
 783INT8U         OSQPostOpt(OS_EVENT *pevent, void *msg, INT8U opt);
 784#endif
 785
 786#if OS_Q_QUERY_EN > 0
 787INT8U         OSQQuery(OS_EVENT *pevent, OS_Q_DATA *p_q_data);
 788#endif
 789
 790#endif
 791
 792/*$PAGE*/
 793/*
 794*********************************************************************************************************
 795*                                          SEMAPHORE MANAGEMENT
 796*********************************************************************************************************
 797*/
 798#if OS_SEM_EN > 0
 799
 800#if OS_SEM_ACCEPT_EN > 0
 801INT16U        OSSemAccept(OS_EVENT *pevent);
 802#endif
 803
 804OS_EVENT     *OSSemCreate(INT16U cnt);
 805
 806#if OS_SEM_DEL_EN > 0
 807OS_EVENT     *OSSemDel(OS_EVENT *pevent, INT8U opt, INT8U *err);
 808#endif
 809
 810void          OSSemPend(OS_EVENT *pevent, INT16U timeout, INT8U *err);
 811INT8U         OSSemPost(OS_EVENT *pevent);
 812
 813#if OS_SEM_QUERY_EN > 0
 814INT8U         OSSemQuery(OS_EVENT *pevent, OS_SEM_DATA *p_sem_data);
 815#endif
 816
 817#if OS_SEM_SET_EN > 0
 818void          OSSemSet(OS_EVENT *pevent, INT16U cnt, INT8U *err);
 819#endif
 820
 821#endif
 822
 823/*$PAGE*/
 824/*
 825*********************************************************************************************************
 826*                                            TASK MANAGEMENT
 827*********************************************************************************************************
 828*/
 829#if OS_TASK_CHANGE_PRIO_EN > 0
 830INT8U         OSTaskChangePrio(INT8U oldprio, INT8U newprio);
 831#endif
 832
 833#if OS_TASK_CREATE_EN > 0
 834INT8U         OSTaskCreate(void (*task)(void *p_arg), void *p_arg, OS_STK *ptos, INT8U prio);
 835#endif
 836
 837#if OS_TASK_CREATE_EXT_EN > 0
 838INT8U         OSTaskCreateExt(void   (*task)(void *p_arg),
 839                              void    *p_arg,
 840                              OS_STK  *ptos,
 841                              INT8U    prio,
 842                              INT16U   id,
 843                              OS_STK  *pbos,
 844                              INT32U   stk_size,
 845                              void    *pext,
 846                              INT16U   opt);
 847#endif
 848
 849#if OS_TASK_DEL_EN > 0
 850INT8U         OSTaskDel(INT8U prio);
 851INT8U         OSTaskDelReq(INT8U prio);
 852#endif
 853
 854#if OS_TASK_NAME_SIZE > 1
 855INT8U         OSTaskNameGet(INT8U prio, INT8U *pname, INT8U *err);
 856void          OSTaskNameSet(INT8U prio, INT8U *pname, INT8U *err);
 857#endif
 858
 859#if OS_TASK_SUSPEND_EN > 0
 860INT8U         OSTaskResume(INT8U prio);
 861INT8U         OSTaskSuspend(INT8U prio);
 862#endif
 863
 864#if OS_TASK_CREATE_EXT_EN > 0
 865INT8U         OSTaskStkChk(INT8U prio, OS_STK_DATA *p_stk_data);
 866#endif
 867
 868#if OS_TASK_QUERY_EN > 0
 869INT8U         OSTaskQuery(INT8U prio, OS_TCB *p_task_data);
 870#endif
 871
 872/*$PAGE*/
 873/*
 874*********************************************************************************************************
 875*                                            TIME MANAGEMENT
 876*********************************************************************************************************
 877*/
 878
 879void          OSTimeDly(INT16U ticks);
 880
 881#if OS_TIME_DLY_HMSM_EN > 0
 882INT8U         OSTimeDlyHMSM(INT8U hours, INT8U minutes, INT8U seconds, INT16U milli);
 883#endif
 884
 885#if OS_TIME_DLY_RESUME_EN > 0
 886INT8U         OSTimeDlyResume(INT8U prio);
 887#endif
 888
 889#if OS_TIME_GET_SET_EN > 0
 890INT32U        OSTimeGet(void);
 891void          OSTimeSet(INT32U ticks);
 892#endif
 893
 894void          OSTimeTick(void);
 895
 896/*
 897*********************************************************************************************************
 898*                                             MISCELLANEOUS
 899*********************************************************************************************************
 900*/
 901
 902void          OSInit(void);
 903
 904void          OSIntEnter(void);
 905void          OSIntExit(void);
 906
 907#if OS_SCHED_LOCK_EN > 0
 908void          OSSchedLock(void);
 909void          OSSchedUnlock(void);
 910#endif
 911
 912void          OSStart(void);
 913
 914void          OSStatInit(void);
 915
 916INT16U        OSVersion(void);
 917
 918/*$PAGE*/
 919/*
 920*********************************************************************************************************
 921*                                      INTERNAL FUNCTION PROTOTYPES
 922*                            (Your application MUST NOT call these functions)
 923*********************************************************************************************************
 924*/
 925
 926#if OS_TASK_DEL_EN > 0
 927void          OS_Dummy(void);
 928#endif
 929
 930#if OS_EVENT_EN
 931INT8U         OS_EventTaskRdy(OS_EVENT *pevent, void *msg, INT8U msk);
 932void          OS_EventTaskWait(OS_EVENT *pevent);
 933void          OS_EventTO(OS_EVENT *pevent);
 934void          OS_EventWaitListInit(OS_EVENT *pevent);
 935#endif
 936
 937#if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
 938void          OS_FlagInit(void);
 939void          OS_FlagUnlink(OS_FLAG_NODE *pnode);
 940#endif
 941
 942void          OS_MemClr(INT8U *pdest, INT16U size);
 943void          OS_MemCopy(INT8U *pdest, INT8U *psrc, INT16U size);
 944
 945#if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
 946void          OS_MemInit(void);
 947#endif
 948
 949#if OS_Q_EN > 0
 950void          OS_QInit(void);
 951#endif
 952
 953void          OS_Sched(void);
 954
 955#if (OS_EVENT_NAME_SIZE > 1) || (OS_FLAG_NAME_SIZE > 1) || (OS_MEM_NAME_SIZE > 1) || (OS_TASK_NAME_SIZE > 1)
 956INT8U         OS_StrCopy(INT8U *pdest, INT8U *psrc);
 957INT8U         OS_StrLen(INT8U *psrc);
 958#endif
 959
 960void          OS_TaskIdle(void *p_arg);
 961
 962#if OS_TASK_STAT_EN > 0
 963void          OS_TaskStat(void *p_arg);
 964#endif
 965
 966#if OS_TASK_CREATE_EXT_EN > 0
 967void          OS_TaskStkClr(OS_STK *pbos, INT32U size, INT16U opt);
 968#endif
 969
 970#if (OS_TASK_STAT_STK_CHK_EN > 0) && (OS_TASK_CREATE_EXT_EN > 0)
 971void          OS_TaskStatStkChk(void);
 972#endif
 973
 974INT8U         OS_TCBInit(INT8U prio, OS_STK *ptos, OS_STK *pbos, INT16U id, INT32U stk_size, void *pext, INT16U opt);
 975
 976/*$PAGE*/
 977/*
 978*********************************************************************************************************
 979*                                          FUNCTION PROTOTYPES
 980*                                      (Target Specific Functions)
 981*********************************************************************************************************
 982*/
 983
 984#if OS_VERSION >= 270 && OS_DEBUG_EN > 0
 985void          OSDebugInit(void);
 986#endif
 987
 988#if OS_VERSION >= 204
 989void          OSInitHookBegin(void);
 990void          OSInitHookEnd(void);
 991#endif
 992
 993#ifndef OS_ISR_PROTO_EXT
 994void          OSIntCtxSw(void);
 995
 996void          OSStartHighRdy(void);
 997#endif
 998
 999void          OSTaskCreateHook(OS_TCB *ptcb);
1000void          OSTaskDelHook(OS_TCB *ptcb);
1001
1002#if OS_VERSION >= 251
1003void          OSTaskIdleHook(void);
1004#endif
1005
1006void          OSTaskStatHook(void);
1007OS_STK       *OSTaskStkInit(void (*task)(void *p_arg), void *p_arg, OS_STK *ptos, INT16U opt);
1008
1009#if OS_TASK_SW_HOOK_EN > 0
1010void          OSTaskSwHook(void);
1011#endif
1012
1013#if OS_VERSION >= 204
1014void          OSTCBInitHook(OS_TCB *ptcb);
1015#endif
1016
1017#if OS_TIME_TICK_HOOK_EN > 0
1018void          OSTimeTickHook(void);
1019#endif
1020
1021/*
1022*********************************************************************************************************
1023*                                          FUNCTION PROTOTYPES
1024*                                  (Compiler Specific ISR prototypes)
1025*********************************************************************************************************
1026*/
1027
1028#ifndef OS_ISR_PROTO_EXT
1029void          OSCtxSw(void);
1030#endif
1031
1032/*$PAGE*/
1033/*
1034*********************************************************************************************************
1035*                                   LOOK FOR MISSING #define CONSTANTS
1036*
1037* This section is used to generate ERROR messages at compile time if certain #define constants are
1038* MISSING in OS_CFG.H.  This allows you to quickly determine the source of the error.
1039*
1040* You SHOULD NOT change this section UNLESS you would like to add more comments as to the source of the
1041* compile time error.
1042*********************************************************************************************************
1043*/
1044
1045/*
1046*********************************************************************************************************
1047*                                            EVENT FLAGS
1048*********************************************************************************************************
1049*/
1050
1051#ifndef OS_FLAG_EN
1052#error  "OS_CFG.H, Missing OS_FLAG_EN: Enable (1) or Disable (0) code generation for Event Flags"
1053#else
1054    #ifndef OS_MAX_FLAGS
1055    #error  "OS_CFG.H, Missing OS_MAX_FLAGS: Max. number of Event Flag Groups in your application"
1056    #else
1057        #if     OS_MAX_FLAGS > 65500u
1058        #error  "OS_CFG.H, OS_MAX_FLAGS must be <= 65500"
1059        #endif
1060    #endif
1061
1062    #if     OS_VERSION >= 280
1063    #ifndef OS_FLAGS_NBITS
1064    #error  "OS_CFG.H, Missing OS_FLAGS_NBITS: Determine #bits used for event flags, MUST be either 8, 16 or 32"
1065    #endif
1066    #endif
1067
1068    #ifndef OS_FLAG_WAIT_CLR_EN
1069    #error  "OS_CFG.H, Missing OS_FLAG_WAIT_CLR_EN: Include code for Wait on Clear EVENT FLAGS"
1070    #endif
1071
1072    #ifndef OS_FLAG_ACCEPT_EN
1073    #error  "OS_CFG.H, Missing OS_FLAG_ACCEPT_EN: Include code for OSFlagAccept()"
1074    #endif
1075
1076    #ifndef OS_FLAG_DEL_EN
1077    #error  "OS_CFG.H, Missing OS_FLAG_DEL_EN: Include code for OSFlagDel()"
1078    #endif
1079
1080    #ifndef OS_FLAG_NAME_SIZE
1081    #error  "OS_CFG.H, Missing OS_FLAG_NAME_SIZE: Determines the size of flag group names"
1082    #endif
1083
1084    #ifndef OS_FLAG_QUERY_EN
1085    #error  "OS_CFG.H, Missing OS_FLAG_QUERY_EN: Include code for OSFlagQuery()"
1086    #endif
1087#endif
1088
1089/*
1090*********************************************************************************************************
1091*                                           MESSAGE MAILBOXES
1092*********************************************************************************************************
1093*/
1094
1095#ifndef OS_MBOX_EN
1096#error  "OS_CFG.H, Missing OS_MBOX_EN: Enable (1) or Disable (0) code generation for MAILBOXES"
1097#else
1098    #ifndef OS_MBOX_ACCEPT_EN
1099    #error  "OS_CFG.H, Missing OS_MBOX_ACCEPT_EN: Include code for OSMboxAccept()"
1100    #endif
1101
1102    #ifndef OS_MBOX_DEL_EN
1103    #error  "OS_CFG.H, Missing OS_MBOX_DEL_EN: Include code for OSMboxDel()"
1104    #endif
1105
1106    #ifndef OS_MBOX_POST_EN
1107    #error  "OS_CFG.H, Missing OS_MBOX_POST_EN: Include code for OSMboxPost()"
1108    #endif
1109
1110    #ifndef OS_MBOX_POST_OPT_EN
1111    #error  "OS_CFG.H, Missing OS_MBOX_POST_OPT_EN: Include code for OSMboxPostOpt()"
1112    #endif
1113
1114    #ifndef OS_MBOX_QUERY_EN
1115    #error  "OS_CFG.H, Missing OS_MBOX_QUERY_EN: Include code for OSMboxQuery()"
1116    #endif
1117#endif
1118
1119/*
1120*********************************************************************************************************
1121*                                           MEMORY MANAGEMENT
1122*********************************************************************************************************
1123*/
1124
1125#ifndef OS_MEM_EN
1126#error  "OS_CFG.H, Missing OS_MEM_EN: Enable (1) or Disable (0) code generation for MEMORY MANAGER"
1127#else
1128    #ifndef OS_MAX_MEM_PART
1129    #error  "OS_CFG.H, Missing OS_MAX_MEM_PART: Max. number of memory partitions"
1130    #else
1131        #if     OS_MAX_MEM_PART > 65500u
1132        #error  "OS_CFG.H, OS_MAX_MEM_PART must be <= 65500"
1133        #endif
1134    #endif
1135
1136    #ifndef OS_MEM_NAME_SIZE
1137    #error  "OS_CFG.H, Missing OS_MEM_NAME_SIZE: Determines the size of memory partition names"
1138    #endif
1139
1140    #ifndef OS_MEM_QUERY_EN
1141    #error  "OS_CFG.H, Missing OS_MEM_QUERY_EN: Include code for OSMemQuery()"
1142    #endif
1143#endif
1144
1145/*
1146*********************************************************************************************************
1147*                                       MUTUAL EXCLUSION SEMAPHORES
1148*********************************************************************************************************
1149*/
1150
1151#ifndef OS_MUTEX_EN
1152#error  "OS_CFG.H, Missing OS_MUTEX_EN: Enable (1) or Disable (0) code generation for MUTEX"
1153#else
1154    #ifndef OS_MUTEX_ACCEPT_EN
1155    #error  "OS_CFG.H, Missing OS_MUTEX_ACCEPT_EN: Include code for OSMutexAccept()"
1156    #endif
1157
1158    #ifndef OS_MUTEX_DEL_EN
1159    #error  "OS_CFG.H, Missing OS_MUTEX_DEL_EN: Include code for OSMutexDel()"
1160    #endif
1161
1162    #ifndef OS_MUTEX_QUERY_EN
1163    #error  "OS_CFG.H, Missing OS_MUTEX_QUERY_EN: Include code for OSMutexQuery()"
1164    #endif
1165#endif
1166
1167/*
1168*********************************************************************************************************
1169*                                              MESSAGE QUEUES
1170*********************************************************************************************************
1171*/
1172
1173#ifndef OS_Q_EN
1174#error  "OS_CFG.H, Missing OS_Q_EN: Enable (1) or Disable (0) code generation for QUEUES"
1175#else
1176    #ifndef OS_MAX_QS
1177    #error  "OS_CFG.H, Missing OS_MAX_QS: Max. number of queue control blocks"
1178    #else
1179        #if     OS_MAX_QS > 65500u
1180        #error  "OS_CFG.H, OS_MAX_QS must be <= 65500"
1181        #endif
1182    #endif
1183
1184    #ifndef OS_Q_ACCEPT_EN
1185    #error  "OS_CFG.H, Missing OS_Q_ACCEPT_EN: Include code for OSQAccept()"
1186    #endif
1187
1188    #ifndef OS_Q_DEL_EN
1189    #error  "OS_CFG.H, Missing OS_Q_DEL_EN: Include code for OSQDel()"
1190    #endif
1191
1192    #ifndef OS_Q_FLUSH_EN
1193    #error  "OS_CFG.H, Missing OS_Q_FLUSH_EN: Include code for OSQFlush()"
1194    #endif
1195
1196    #ifndef OS_Q_POST_EN
1197    #error  "OS_CFG.H, Missing OS_Q_POST_EN: Include code for OSQPost()"
1198    #endif
1199
1200    #ifndef OS_Q_POST_FRONT_EN
1201    #error  "OS_CFG.H, Missing OS_Q_POST_FRONT_EN: Include code for OSQPostFront()"
1202    #endif
1203
1204    #ifndef OS_Q_POST_OPT_EN
1205    #error  "OS_CFG.H, Missing OS_Q_POST_OPT_EN: Include code for OSQPostOpt()"
1206    #endif
1207
1208    #ifndef OS_Q_QUERY_EN
1209 

Large files files are truncated, but you can click here to view the full file