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

📄 os_cfg.h

📁 UCOSII-2.61源码
💻 H
字号:
/*
*******************************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*
*                           (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
*                                  uC/OS-II Configuration File for V2.60
*
* File : OS_CFG.H
* By   : Jean J. Labrosse
*******************************************************************************************************************
*/
#ifndef OS_CFG_H
#define OS_CFG_H

                                                 /* --------------------- SYSTEM CONFIG ------------------------ */
                                                 /* Defines the lowest priority that can be assigned ...         */
#define OS_LOWEST_PRIO                     16    /* ... MUST NEVER be higher than 63!                            */
#define OS_MAX_TASKS                        8    /* Max. number of tasks in your application, MUST be >= 2       */
#define TaskStkSize                        64    /* Stack size of each task                                      */


                                                 /* ------------------- TASK COMMUNICATION --------------------- */
#define OS_EVENT_NAME_SIZE                  0    /* Determine the size of the name of a Sem, Mutex, Mbox or Q    */
#define OS_MAX_EVENTS                       8    /* Max. number of event control blocks in your application      */

                                                 /* ----------------------- EVENT FLAGS ------------------------ */
typedef unsigned int                OS_FLAGS;    /* Date type for event flag bits (8, 16 or 32 bits)             */
#define OS_FLAG_NAME_SIZE                   0    /*     Determine the size of the name of an event flag group    */
#define OS_MAX_FLAGS                        0    /* Max. number of Event Flag Groups    in your application      */
#define OS_FLAG_EN                          0    /* Enable (1) or Disable (0) code generation for EVENT FLAGS    */
    #define OS_FLAG_WAIT_CLR_EN             0    /* Include code for Wait on Clear EVENT FLAGS                   */
    #define OS_FLAG_ACCEPT_EN               0    /*     Include code for OSFlagAccept()                          */
    #define OS_FLAG_DEL_EN                  0    /*     Include code for OSFlagDel()                             */
    #define OS_FLAG_QUERY_EN                0    /*     Include code for OSFlagQuery()                           */

                                                 /* -------------------- MESSAGE MAILBOXES --------------------- */
#define OS_MBOX_EN                          0    /* Enable (1) or Disable (0) code generation for MAILBOXES      */
    #define OS_MBOX_ACCEPT_EN               0    /*     Include code for OSMboxAccept()                          */
    #define OS_MBOX_DEL_EN                  0    /*     Include code for OSMboxDel()                             */
    #define OS_MBOX_POST_EN                 0    /*     Include code for OSMboxPost()                            */
    #define OS_MBOX_POST_OPT_EN             0    /*     Include code for OSMboxPostOpt()                         */
    #define OS_MBOX_QUERY_EN                0    /*     Include code for OSMboxQuery()                           */

                                                 /* ---------------- MUTUAL EXCLUSION SEMAPHORES --------------- */
#define OS_MUTEX_EN                         0    /* Enable (1) or Disable (0) code generation for MUTEX          */
    #define OS_MUTEX_ACCEPT_EN              0    /*     Include code for OSMutexAccept()                         */
    #define OS_MUTEX_DEL_EN                 0    /*     Include code for OSMutexDel()                            */
    #define OS_MUTEX_QUERY_EN               0    /*     Include code for OSMutexQuery()                          */

                                                 /* ---------------------- MESSAGE QUEUES ---------------------- */
#define OS_MAX_QS                           0    /* Max. number of queue control blocks in your application      */
#define OS_Q_EN                             0    /* Enable (1) or Disable (0) code generation for QUEUES         */
    #define OS_Q_ACCEPT_EN                  0    /*     Include code for OSQAccept()                             */
    #define OS_Q_DEL_EN                     0    /*     Include code for OSQDel()                                */
    #define OS_Q_FLUSH_EN                   0    /*     Include code for OSQFlush()                              */
    #define OS_Q_POST_EN                    0    /*     Include code for OSQPost()                               */
    #define OS_Q_POST_FRONT_EN              0    /*     Include code for OSQPostFront()                          */
    #define OS_Q_POST_OPT_EN                0    /*     Include code for OSQPostOpt()                            */
    #define OS_Q_QUERY_EN                   0    /*     Include code for OSQQuery()                              */

                                                 /* ------------------------ SEMAPHORES ------------------------ */
#define OS_SEM_EN                           0    /* Enable (1) or Disable (0) code generation for SEMAPHORES     */
    #define OS_SEM_ACCEPT_EN                0    /*    Include code for OSSemAccept()                            */
    #define OS_SEM_DEL_EN                   0    /*    Include code for OSSemDel()                               */
    #define OS_SEM_QUERY_EN                 0    /*    Include code for OSSemQuery()                             */



                                                 /* --------------------- TASK MANAGEMENT ---------------------- */
#define OS_TASK_NAME_SIZE                   0    /*     Determine the size of a task name                        */
#define OS_TASK_PROFILE_EN                  0    /*     Include variables in OS_TCB for profiling                */
#define OS_TASK_CHANGE_PRIO_EN              0    /*     Include code for OSTaskChangePrio()                      */
#define OS_TASK_CREATE_EN                   1    /*     Include code for OSTaskCreate()                          */
#define OS_TASK_CREATE_EXT_EN               0    /*     Include code for OSTaskCreateExt()                       */
    #define OS_TASK_STK_CHK_EN              0    /*     Include code for OSTaskStkChk()                          */
  #define OS_TASK_STAT_EN                   0    /* Enable (1) or Disable(0) the statistics task                 */
        #define OS_TASK_STAT_STK_CHK_EN     0    /* Check task stacks from statistic task                        */
#define OS_TASK_DEL_EN                      0    /*     Include code for OSTaskDel()                             */
    #define OS_TASK_DEL_REQ_EN              0    /*     Include code for OSTaskDelReq()                          */
#define OS_TASK_QUERY_EN                    0    /*     Include code for OSTaskQuery()                           */
#define OS_TASK_SUSPEND_EN                  0    /*     Include code for OSTaskSuspend() and OSTaskResume()      */


                                                 /* ---------------------- MISCELLANEOUS ----------------------- */
#define OS_SCHED_LOCK_EN                    0    /*     Include code for OSSchedLock() and OSSchedUnlock()       */
#define OS_VERSION_EN                       0    /*     Include code for OSVersion()                             */


                                                 /* --------------------- TIME MANAGEMENT ---------------------- */
#define OS_TIME_DLY_EN                      1    /*     Include code for OSTimeDly()                             */
    #define OS_TIME_DLY_HMSM_EN             0    /*     Include code for OSTimeDlyHMSM()                         */
    #define OS_TIME_DLY_RESUME_EN           0    /*     Include code for OSTimeDlyResume()                       */
#define OS_TIME_GET_SET_EN                  0    /*     Include code for OSTimeGet() and OSTimeSet()             */


                                                 /* ------------------------ OS HOOK --------------------------- */
#define OS_TASK_SW_HOOK_EN                  1    /*     Include code for OSTaskSwHook() Must modify os_cpu_a.asm */
#define OS_CPU_HOOKS_EN                     0    /* uC/OS-II hooks are found in the processor port files         */
    #define OS_INIT_HOOK_BEGIN_EN           0    /*     Include code for OSInitHookBegin()                       */
    #define OS_INIT_HOOK_END_EN             0    /*     Include code for OSInitHookEnd()                         */
    #define OS_TASK_CREATE_HOOK_EN          0    /*     Include code for OSTaskCreateHook()                      */
    #define OS_TASK_DEL_HOOK_EN             0    /*     Include code for OSTaskDelHook()                         */
    #define OS_TASK_IDEL_HOOK_EN            0    /*     Include code for OSTaskIdleHook()                        */
    #define OS_TASK_STAT_HOOK_EN            0    /*     Include code for OSTaskStatHook()                        */
    #define OS_TCB_INIT_HOOK_EN             0    /*     Include code for OSTCBInitHook()                         */
    #define OS_TIME_TICK_HOOK_EN            0    /*     Include code for OSTimeTickHook()                        */


                                                 /* --------------------- MEMORY MANAGEMENT -------------------- */
#define OS_MAX_MEM_PART                     0    /* Max. number of memory partitions                             */
#define OS_MEM_EN                           0    /* Enable (1) or Disable (0) code generation for MEMORY MANAGER */
    #define OS_MEM_QUERY_EN                 0    /*     Include code for OSMemQuery()                            */
    #define OS_MEM_NAME_SIZE                0    /*     Determine the size of a memory partition name            */


                                                 /* -------------------------- OS DEBUG ------------------------ */
#define OS_ARG_CHK_EN                       0    /* Enable (1) or Disable (0) argument checking                  */
#define OS_DEBUG_EN                         0    /* Enable(1) debug variables                                    */
#define OS_TICK_STEP_EN                     0    /* Enable tick stepping feature for uC/OS-View                  */



#define OS_TASK_IDLE_STK_SIZE   TaskStkSize      /* Idle task stack size (# of OS_STK wide entries)              */
#define OS_TASK_STAT_STK_SIZE   TaskStkSize      /* Statistics task stack size (# of OS_STK wide entries)        */


/* 
*********************************************************************************************************
*                              Intel 80x51 Large Model
*
* Method #1:  Disable/Enable interrupts using simple instructions.  After critical section, interrupts
*             will be enabled even if they were disabled before entering the critical section.
*
* Method #2:  Disable/Enable interrupts by preserving the state of interrupts.  In other words, if 
*             interrupts were disabled before entering the critical section, they will be disabled when
*             leaving the critical section.
*
* Method #3:  Disable/Enable interrupts by preserving the state of interrupts.  Generally speaking you
*             would store the state of the interrupt disable flag in the local variable 'cpu_sr' and then
*             disable interrupts.  'cpu_sr' is allocated in all of uC/OS-II's functions that need to 
*             disable interrupts.  You would restore the interrupt disable state by copying back 'cpu_sr'
*             into the CPU's status register.
*********************************************************************************************************
*/
#define  OS_CRITICAL_METHOD     3

#endif      //#ifndef OS_CFG_H

⌨️ 快捷键说明

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