UCOSIII OS_CFG.H 解释整理

/*
************************************************************************************************************************
*                                                      uC/OS-III
*                                                 The Real-Time Kernel
*
*                                  (c) Copyright 2009-2012; Micrium, Inc.; Weston, FL
*                           All rights reserved.  Protected by international copyright laws.
*
*                                                  CONFIGURATION FILE
*
* File    : OS_CFG.H
* By      : JJL
* Version : V3.03.01
*
* LICENSING TERMS:
* ---------------
*           uC/OS-III is provided in source form for FREE short-term evaluation, for educational use or
*           for peaceful research.  If you plan or intend to use uC/OS-III in a commercial application/
*           product then, you need to contact Micrium to properly license uC/OS-III for its use in your
*           application/product.   We provide ALL the source code for your convenience and to help you
*           experience uC/OS-III.  The fact that the source is provided does NOT mean that you can use
*           it commercially without paying a licensing fee.
*
*           Knowledge of the source code may NOT be used to develop a similar product.
*
*           Please help us continue to provide the embedded community with the finest software available.
*           Your honesty is greatly appreciated.
*
*           You can contact us at www.micrium.com, or by phone at +1 (954) 217-2036.
************************************************************************************************************************
*/

#ifndef OS_CFG_H
#define OS_CFG_H


                                             /* ---------------------------- MISCELLANEOUS -------------------------- */
#define OS_CFG_APP_HOOKS_EN             1u   /* Enable (1) or Disable (0) application specific hooks                  */
											 /* 设置为1时,说明μC/OS-III的钩子函数(介入函数)可以调用用户定义的钩子函数.从而 */
											 /* 实现μC/OS-III自身的功能能够扩充,通过用户程序代码实现.当然,如果根本不打算扩 */
											 /* 充μC/OS-III钩子函数功能,则将该宏设置为0,来节省内存。                    */
											 
#define OS_CFG_ARG_CHK_EN               1u   /* Enable (1) or Disable (0) argument checking                           */
											 /* 该宏决定用户是否希望对μC/OS-III的大部分函数执行参数检查,如确保传递传递给函 */
											 /* 数的指针非NULL、参数值在允许的范围内、选项是有效的等。当设置为0时,将禁止参 */
											 /* 数检查功能,相应的节省内核的代码空间和处理时间。统计发现,μC/OS-III为超过40 */
											 /* 个函数提供参数检查功能。因此,禁用此选项将节约几百字节的代码空间。应用中,可 */
											 /* 以考虑调试阶段开启此选项,项目的后期发布阶段禁止该选项。                   */
											 
#define OS_CFG_CALLED_FROM_ISR_CHK_EN   1u   /* Enable (1) or Disable (0) check for called from ISR                   */
											 /*决定内核是否进行检查以确保大多数的函数没有被ISR调用。换句话说,大多数μC/OS-III*/
											 /* 函数应该只被任务级代码调用,除了“POST”类的发送函数(它们可以被ISR调用)。 	  */
											 /* μC/OS-III为大约50个函数提供此项检查。因此,禁用此选项,将节约几百字节的代码 */
											 /* 空间。应用中,可以考虑调试阶段开启此选项,项目的后期发布阶段禁止该选项。     */
											 
#define OS_CFG_DBG_EN                   1u   /* Enable (1) debug code/variables                                       */
											 /*当这个宏设置为1时,os_dbg.c中的ROM常量将被添加以帮助支持内核调试器。具体来说,*/
											 /*调试器将可以通过查询一系列所谓的ROM变量,来获知编译时的选项。例如,调试器可以找*/
											 /*出OS_TCB的尺寸大小、μC/OS-III的版本号、一个事件标志组的尺寸(OS_FLAG_GRP)等。*/
											
#define OS_CFG_ISR_POST_DEFERRED_EN     1u   /* Enable (1) or Disable (0) Deferred ISR posts 通过调度器上锁来访问临界段*/
											 /*使能则有短的中断延时,但是有长的ISR—to—task响应*/
											
#define OS_CFG_OBJ_TYPE_CHK_EN          1u   /* Enable (1) or Disable (0) object type checking                        */
											 /*对象类型检测(调试的时候允许)*/
											
#define OS_CFG_TS_EN                    1u   /* Enable (1) or Disable (0) time stamping                               */
											 /*时间戳使能*/
											
#define OS_CFG_PEND_MULTI_EN            0u   /* Enable (1) or Disable (0) code generation for multi-pend feature      */
											 /*是否支持事件的多路等待功能*/

#define OS_CFG_PRIO_MAX                64u   /* Defines the maximum number of task priorities (see OS_PRIO data type) */
											 /*任务优先级的最大数*/

#define OS_CFG_SCHED_LOCK_TIME_MEAS_EN  1u   /* Include code to measure scheduler lock time                           */
											 /*包含测量调度锁定时间的代码 */
											 
#define OS_CFG_SCHED_ROUND_ROBIN_EN     1u   /* Include code for Round-Robin scheduling                               */
											 /*包含轮转调度的代码*/
											 
#define OS_CFG_STK_SIZE_MIN            64u   /* Minimum allowable task stack size                                     */
											 /*最小允许的任务堆栈的大小*/


                                             /* ----------------------------- EVENT FLAGS --------------------------- */
#define OS_CFG_FLAG_EN                  1u   /* Enable (1) or Disable (0) code generation for EVENT FLAGS             */
											 /*设置为1时,允许生成事件标志服务的代码和数据结构,即开启了事件标志服务功能。*/
											 /*如果设置为0,那么无需再开启/禁止该文件中任何名称为OS_CFG_FLAG_xxx的#define*/
											 /*常量。应用不需要相关服务时,可以禁止该功能,以此来减少代码和数据的空间需求。*/
											 
#define OS_CFG_FLAG_DEL_EN              1u   /*     Include code for OSFlagDel()                                      */
											 /*决定是否生成OSFlagDel()函数代码。*/
											 
#define OS_CFG_FLAG_MODE_CLR_EN         1u   /*     Include code for Wait on Clear EVENT FLAGS                        */
											 /*是否生成代码用于等待事件标志变为0.通常是等待事件标志被置为1。但是用户也可能*/
											 /*需要等待事件标志的清零,在这种情况下,需要开启此选项。*/
											 
#define OS_CFG_FLAG_PEND_ABORT_EN       1u   /*     Include code for OSFlagPendAbort()                                */
											 /*OSFlagPendAbort().函数是否生成。*/


                                             /* -------------------------- MEMORY MANAGEMENT ------------------------ */
#define OS_CFG_MEM_EN                   1u   /* Enable (1) or Disable (0) code generation for MEMORY MANAGER          */
											 /*决定是否生成分区存储管理代码和相关的数据结构。这让用户在不使用存储分区时,减少*/
											 /*代码和数据的空间需求。*/

                                             /* --------------------- MUTUAL EXCLUSION SEMAPHORES ------------------- */
#define OS_CFG_MUTEX_EN                 1u   /* Enable (1) or Disable (0) code generation for MUTEX                   */
											 /*决定是否开启互斥信号量服务的代码和数据结构。同其他的内核服务开关一样         */
											 /*OS_CFG_MUTEX_EN被设置为0,那么无需再开启/禁止本系统中任何名为              */
											 /*OS_CFG_MUTEX_XXX 的#define常量。*/
											 
#define OS_CFG_MUTEX_DEL_EN             1u   /*     Include code for OSMutexDel()                                     */
											 /*互斥性信号量删除功能使能   */
											 
#define OS_CFG_MUTEX_PEND_ABORT_EN      1u   /*     Include code for OSMutexPendAbort()                               */
											 /*互斥性信号量等待终止功能使能*/
											 


                                             /* --------------------------- MESSAGE QUEUES -------------------------- */
#define OS_CFG_Q_EN                     1u   /* Enable (1) or Disable (0) code generation for QUEUES                  */
											 /*消息队列功能使能*/
											 
#define OS_CFG_Q_DEL_EN                 1u   /*     Include code for OSQDel()                                         */
											 /*消息队列删除功能使能*/
											 
#define OS_CFG_Q_FLUSH_EN               1u   /*     Include code for OSQFlush()                                       */
											 /*消息队列刷新功能使能*/
											 
#define OS_CFG_Q_PEND_ABORT_EN          1u   /*     Include code for OSQPendAbort()                                   */
											 /*消息队列等待终止功能使能  */
											 


                                             /* ----------------------------- SEMAPHORES ---------------------------- */
#define OS_CFG_SEM_EN                   1u   /* Enable (1) or Disable (0) code generation for SEMAPHORES              */
											 /*信号量功能使能*/
											 
#define OS_CFG_SEM_DEL_EN               1u   /*    Include code for OSSemDel()                                        */
											 /*信号量删除功能使能  */
											 
#define OS_CFG_SEM_PEND_ABORT_EN        1u   /*    Include code for OSSemPendAbort()                                  */
											 /*信号量等待终止功能使能*/
											 
#define OS_CFG_SEM_SET_EN               1u   /*    Include code for OSSemSet()                                        */
											 /*信号量置位功能使能*/
											 


                                             /* -------------------------- TASK MANAGEMENT -------------------------- */
#define OS_CFG_STAT_TASK_EN             1u   /* Enable (1) or Disable(0) the statistics task                          */
											 /*统计功能使能*/
											 
#define OS_CFG_STAT_TASK_STK_CHK_EN     1u   /* Check task stacks from statistic task                                 */
											 /*统计任务堆栈检测功能使能 */
											 
#define OS_CFG_TASK_CHANGE_PRIO_EN      1u   /* Include code for OSTaskChangePrio()                                   */
											 /*改变任务优先级功能使能  */
											 
#define OS_CFG_TASK_DEL_EN              1u   /* Include code for OSTaskDel()                                          */
											 /*任务删除功能使能*/
											 
#define OS_CFG_TASK_Q_EN                1u   /* Include code for OSTaskQXXXX()                                        */
											 /*任务消息队列功能使能 */
											 
#define OS_CFG_TASK_Q_PEND_ABORT_EN     1u   /* Include code for OSTaskQPendAbort()                                   */
											 /*任务消息队列等待取消功能使能*/
											 
#define OS_CFG_TASK_PROFILE_EN          1u   /* Include variables in OS_TCB for profiling                             */
											 /*使能任务的详细情况功能,包括任务的切换次数,执行时间,相对于其他任务的CPU利用率*/
											 
#define OS_CFG_TASK_REG_TBL_SIZE        1u   /* Number of task specific registers                                     */
											 /*任务特殊功能寄存器     */
											 
#define OS_CFG_TASK_SEM_PEND_ABORT_EN   1u   /* Include code for OSTaskSemPendAbort()                                 */
											 /*任务信号量等待取消功能使能*/
											 
#define OS_CFG_TASK_SUSPEND_EN          1u   /* Include code for OSTaskSuspend() and OSTaskResume()                   */
											 /*任务暂时中止和恢复功能使能*/
											 


                                             /* -------------------------- TIME MANAGEMENT -------------------------- */
#define OS_CFG_TIME_DLY_HMSM_EN         1u   /*     Include code for OSTimeDlyHMSM()                                  */
											 /*时间延时函数使能*/
											 
#define OS_CFG_TIME_DLY_RESUME_EN       1u   /*     Include code for OSTimeDlyResume()                                */
											 /*时间延时取消功能使能 */
											 


                                             /* ------------------- TASK LOCAL STORAGE MANAGEMENT ------------------- */
#define OS_CFG_TLS_TBL_SIZE             0u   /* Include code for Task Local Storage (TLS) registers                   */
											 /*决定数组的大小:.TLS_Tbl[],在每个任务的OS_TCB。OS_CFG_TLS_TBL_SIZE为   */
											 /*TLS(thread-local storage)服务,当OS_CFG_TLS_TBL_SIZE大于0时开启,等于0时*/
											 /*禁用。TLS特性在V3.03.00.版本加入*/
											 

                                             /* ------------------------- TIMER MANAGEMENT -------------------------- */
#define OS_CFG_TMR_EN                   1u   /* Enable (1) or Disable (0) code generation for TIMERS                  */
											 /*定时器功能使能*/
											 
#define OS_CFG_TMR_DEL_EN               1u   /* Enable (1) or Disable (0) code generation for OSTmrDel()              */
										 	 /*定时器删除功能使能*/
#endif

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程宸宸

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值