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

📄 nu_defs.h

📁 NecluesRTX RTOS的源码
💻 H
字号:
/************************************************************************/
/*                                                                      */
/*              Copyright 1990 by Accelerated Technology                */
/*                                                                      */
/*  PROPRIETARY RIGHTS of Accelerated Technology are involved in the    */
/*  subject matter of this material.  All manufacturing, reproduction,  */
/*  use, and sales rights pertaining to this subject matter are         */
/*  governed by the license agreement.  The buyer or recipient of this  */
/*  package, implicitly accepts the terms of the license.               */
/*                                                                      */
/************************************************************************/

/************************************************************************/
/*                                                                      */
/*  FILE DESCRIPTION                                                    */
/*                                                                      */
/*  This file contains general system constants for the nucleus         */
/*  executive.                                                          */
/*                                                                      */
/*  ROUTINES                                                            */
/*                                                                      */
/*      None                                                            */
/*                                                                      */
/*  NOTES                                                               */
/*                                                                      */
/*      None                                                            */
/*                                                                      */
/************************************************************************/


/* General constants.   */

#define            NU_FALSE          0      /* Equate for false         */
#define            NU_FOREVER        1      /* Equate for infinite loops*/
#define            NU_IGNORE_VALUE  -1      /* Null parameter value     */
#define            NU_MIN_PRIORITY   255    /* Lowest priority for task */
#define            NU_NO_PREEMPT     0      /* No preemption            */
#define            NU_NO_TIMEOUT    -1      /* No timeout requested     */
#define            NU_NULL           0      /* Equate for no entry      */
#define            NU_PREEMPT        1      /* Preempt                  */
#define            NU_TRUE           1      /* Equate for true          */
#define            NU_WAIT_FOREVER   0      /* Maximum timeout requested*/
#define            NU_EVENT_AND      1      /* And of event flags       */
#define            NU_EVENT_OR       2      /* Or of event flags        */
#define            NU_EVENT_AND_CONSUME  3  /* And of event flags cons. */
#define            NU_EVENT_OR_CONSUME   4  /* Or of event flags cons.  */


/* Task ID value when in system mode.  */

#define            NU_SYSTEM        -1      /* Indicates scheduling loop*/


/* Equates for turning on/off interrupts.  */

#define        NU_ENABLE_INTERRUPTS   0x2000 /* Turn interrupts on       */
#define        NU_DISABLE_INTERRUPTS  0x2700 /* Turn interrupts off      */


/* Timer type definitions.   */

#define        NU_ONESHOT            1      /* Timer is active only once*/
#define        NU_PERIODIC           2      /* Timer stays active       */


/* Global task suspension constants.  */

#define        NU_READY              0      /* Task is ready            */
#define        NU_PURE_SUSPEND       1      /* Task is unconditionally  
                                               suspended.               */
#define        NU_QUEUE_SUSPEND      2      /* Task is suspended on a   
                                               communication queue      */
#define        NU_RESOURCE_SUSPEND   3      /* Task is suspended on a
                                               resource semaphore       */
#define        NU_TIME_SUSPEND       4      /* Task is suspended for a  
                                               specific period of time  */
#define        NU_MEMORY_SUSPEND     5      /* Task is waiting for some
                                               memory                   */
#define        NU_EVENT_SUSPEND      6      /* Task is waiting for an 
                                               event                    */

/* Performance Timer constants.  */

#define        NU_EXECUTION_TIME_TIMER  0   /* Task's execution timer   */
#define        NU_SUSPENSION_TIME_TIMER 1   /* Task's suspension timer  */
#define        NU_READY_WAIT_TIME_TIMER 2   /* Task's ready but waiting */
#define        NU_USER_TIMER_1          3   /* Task general timer 1     */
#define        NU_USER_TIMER_2          4   /* Task general timer 2     */
#define        NU_USER_TIMER_3          5   /* Task general timer 3     */


/* History event constants.  */

#define        NU_NO_EVENT                      -1   /* No event is present */
#define        NU_HIST_TASK_SUSPEND              0   /* Task suspended      */
#define        NU_HIST_TASK_READY                1   /* Task is ready       */
#define        NU_HIST_TASK_RESUMED              2   /* Task is resumed     */
#define        NU_HIST_NU_ALLOC_MEMORY           3   /* Allocate memory     */
#define        NU_HIST_NU_ALLOC_PARTITION        4   /* Allocate partition  */
#define        NU_HIST_NU_AVAILABLE_MEMORY       5   /* Available memory    */
#define        NU_HIST_NU_AVAILABLE_PARTITIONS   6   /* Available partitions*/
#define        NU_HIST_NU_CHANGE_PRIORITY        7   /* Change priority     */
#define        NU_HIST_NU_CHANGE_TIME_SLICE      8   /* Change time slice   */
#define        NU_HIST_NU_CONTROL_INTERRUPTS     9   /* Control interrupts  */
#define        NU_HIST_NU_CURRENT_TASK_ID        10  /* Current task ID     */
#define        NU_HIST_NU_DEALLOC_MEMORY         11  /* Deallocate memory   */
#define        NU_HIST_NU_DEALLOC_PARTITION      12  /* Deallocate partition*/
#define        NU_HIST_NU_DISABLE_PREEMPTION     13  /* Disable preemption  */
#define        NU_HIST_NU_ENABLE_INTERRUPTS      14  /* Enable interrupts   */
#define        NU_HIST_NU_ENABLE_PREEMPTION      15  /* Enable preemption   */
#define        NU_HIST_NU_FORCE_ITEM_IN_FRONT    16  /* Force item in front */
#define        NU_HIST_NU_FREE_MEMORY            17  /* Free memory         */
#define        NU_HIST_NU_READ_TIME              18  /* Read time           */
#define        NU_HIST_NU_RELEASE_RESOURCE       19  /* Release resource    */
#define        NU_HIST_NU_RELINQUISH             20  /* Relinquish          */
#define        NU_HIST_NU_REQUEST_RESOURCE       21  /* Request resource    */
#define        NU_HIST_NU_RESET                  22  /* Reset               */
#define        NU_HIST_NU_RETRIEVE_ITEM          23  /* Retrieve Item       */
#define        NU_HIST_NU_RETRIEVE_ITEM_MULT     24  /* Retrieve Item Mult  */
#define        NU_HIST_NU_RETRIEVE_QUEUE_STAT    25  /* Retrieve Queue stat */
#define        NU_HIST_NU_RETRIEVE_RESOURCE_ST   26  /* Retrieve Resource   */
#define        NU_HIST_NU_RETRIEVE_TASK_STATUS   27  /* Retrieve task status*/
#define        NU_HIST_NU_SEND_ITEM              28  /* Send item           */
#define        NU_HIST_NU_SET_EVENTS             29  /* Set Events          */
#define        NU_HIST_NU_SET_TIME               30  /* Set time            */
#define        NU_HIST_NU_SLEEP                  31  /* Sleep               */
#define        NU_HIST_NU_START                  32  /* Start task          */
#define        NU_HIST_NU_STOP                   33  /* Stop a task         */
#define        NU_HIST_NU_WAIT_FOR_EVENTS        34  /* Wait for an event   */


/* Nucleus return status values.  */

#define        NU_EVENT_TIMEOUT         -1  /* Event timeout            */
#define        NU_EVENTS_NOT_PRESENT    -2  /* Events not present       */
#define        NU_HISTORY_NOT_STARTED   -3  /* History not started      */
#define        NU_HISTORY_NOT_STOPPED   -4  /* History was not stopped  */
#define        NU_INVALID_EVENT_GROUP   -5  /* Invalid event group ID   */
#define        NU_INVALID_EVENT_OPERATION -6 /* Invalid event operation  */
#define        NU_INVALID_PARTITION     -7  /* Invalid partition ID     */
#define        NU_INVALID_PER_TIMER     -8  /* Invalid performance timer*/
#define        NU_INVALID_QUEUE         -9  /* Invalid queue selection  */
#define        NU_INVALID_RESOURCE      -10 /* Invalid resource ID      */
#define        NU_INVALID_SELECTION     -11 /* Invalid selection        */
#define        NU_INVALID_TASK          -12 /* Invalid task ID selection*/
#define        NU_NO_FREE_MEMORY        -13 /* No memory status         */
#define        NU_NO_FREE_PARTITIONS    -14 /* No free partitions       */
#define        NU_NOT_ACTIVE            -15 /* Task was not active      */
#define        NU_NOT_ALLOCATED         -16 /* Resource not allocated   */
#define        NU_NOT_AVAILABLE         -17 /* Resource not available   */
#define        NU_NOT_IMPLEMENTED       -18 /* Request not implemented  */
#define        NU_NOT_INUSE             -19 /* Memory part not inuse    */
#define        NU_NOT_SUSPENDED         -20 /* Task was not suspended   */
#define        NU_PER_TIMER_STARTED     -21 /* Performance timer started*/
#define        NU_PER_TIMER_STOPPED     -22 /* Performance timer stopped*/
#define        NU_QUEUE_EMPTY           -23 /* Queue empty              */
#define        NU_QUEUE_FULL            -24 /* Queue full               */
#define        NU_QUEUE_TIMEOUT         -25 /* Queue timeout condition  */
#define        NU_RESOURCE_TIMEOUT      -26 /* Resource timeout         */

#define        NU_SUCCESS            0      /* Call was successful      */


/* Nucleus system errors which result in a call to 
   IND_Major_System_Errors.  */

#define        NU_NOT_ENOUGH_MEMORY  1  /* Not enough memory to init    */
#define        NU_NO_TASKS           2  /* No tasks defined             */
#define        NU_PARTITION_SIZE     3  /* Invalid partition size       */
#define        NU_QUEUE_ITEM_SIZE    4  /* Invalid queue item size      */
#define        NU_MEMORY_SLICKED     5  /* Memory slicked by someone    */
#define        NU_TASK_STACK_SLICKED 6  /* The begining of the task's   */ 
                                        /* stack has been overwritten   */
                                        

⌨️ 快捷键说明

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