ucos-ii(英文版)chapter12.configurationmanual

上传人:小** 文档编号:47163294 上传时间:2018-06-30 格式:PDF 页数:10 大小:31.41KB
返回 下载 相关 举报
ucos-ii(英文版)chapter12.configurationmanual_第1页
第1页 / 共10页
ucos-ii(英文版)chapter12.configurationmanual_第2页
第2页 / 共10页
ucos-ii(英文版)chapter12.configurationmanual_第3页
第3页 / 共10页
ucos-ii(英文版)chapter12.configurationmanual_第4页
第4页 / 共10页
ucos-ii(英文版)chapter12.configurationmanual_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《ucos-ii(英文版)chapter12.configurationmanual》由会员分享,可在线阅读,更多相关《ucos-ii(英文版)chapter12.configurationmanual(10页珍藏版)》请在金锄头文库上搜索。

1、Chapter 12 Configuration Manual This chapter provides a description of the configurable elements of C/OS-II. Because C/OS-II is provided in source form, configuration of C/OS-II is done through a number of #define constants. The #define constants are found in a file called OS_CFG.H and should exist

2、for each project/product that you make. This section describes each of the #define constant in the order in which they are found in OS_CFG.H. Table 12-1 provides a summary of these constants and which C/OS-II functions they affect. Of course, OS_CFG.H must be included when C/OS-II is built in order

3、for the desired configuration to take effect. ServiceSet to 1 to enable codeOther config. constant(s) affecting function MiscellaneousOSInit()N/AOS_MAX_EVENTS, OS_Q_EN and OS_MAX_QS, OS_MEM_EN, OS_TASK_IDLE_STK_SIZE, OS_TASK_STAT_EN, OS_TASK_STAT_STK_SIZEOSSchedLock()N/AN/AOSSchedUnlock()N/AN/AOSSta

4、rt()N/AN/AOSStatInit()OS_TASK_STAT_EN & OS_TASK_CREATE_EXT_ENOS_TICKS_PER_SECOSVersion()N/AN/A Interrupt ManagementOSIntEnter()N/AN/AOSIntExit()N/AN/A Message MailboxesOSMboxAccept()OS_MBOX_ENN/AOSMboxCreate()OS_MBOX_ENOS_MAX_EVENTSOSMboxPend()OS_MBOX_ENN/AOSMboxPost()OS_MBOX_ENN/A OSMboxQuery()OS_M

5、BOX_ENN/A Memory Partition ManagementOSMemCreate()OS_MEM_ENOS_MAX_MEM_PARTOSMemGet()OS_MEM_ENN/AOSMemPut()OS_MEM_ENN/AOSMemQuery()OS_MEM_ENN/AMessage QueuesOSQAccept()OS_Q_ENN/AOSQCreate()OS_Q_ENOS_MAX_EVENTS, OS_MAX_QSOSQFlush()OS_Q_ENN/AOSQPend()OS_Q_ENN/AOSQPost()OS_Q_ENN/AOSQPostFront()OS_Q_ENN/

6、A OSQQuery()OS_Q_ENN/ATable 12-1a ServiceSet to 1 to enable codeOther config. constant(s) affecting function Semaphore ManagementOSSemAccept()OS_SEM_ENN/AOSSemCreate()OS_SEM_ENOS_MAX_EVENTSOSSemPend()OS_SEM_ENN/AOSSemPost()OS_SEM_ENN/A OSSemQuery()OS_SEM_ENN/A Task ManagementOSTaskChangePrio()OS_TAS

7、K_CHANGE_PRIO_ENOS_MAX_TASKSOSTaskCreate()OS_TASK_CREATE_ENOS_MAX_TASKSOSTaskCreateExt()OS_TASK_CREATE_EXT_ENOS_MAX_TASKS, OS_TASK_STK_CLROSTaskDel()OS_TASK_DEL_ENOS_MAX_TASKSOSTaskDelReq()OS_TASK_DEL_ENOS_MAX_TASKSOSTaskResume()OS_TASK_SUSPEND_ENOS_MAX_TASKSOSTaskStkChk()OS_TASK_CREATE_EXT_ENOS_MAX

8、_TASKSOSTaskSuspend()OS_TASK_SUSPEND_ENOS_MAX_TASKSOSTaskQuery()OS_MAX_TASKS Time ManagementOSTimeDly()N/AN/AOSTimeDlyHMSM()N/AOS_TICKS_PER_SECOSTimeDlyResume()N/AOS_MAX_TASKSOSTimeGet()N/AN/AOSTimeSet()N/AN/AOSTimeTick()N/AN/A User Defined FunctionsOSTaskCreateHook()OS_CPU_HOOKS_ENN/AOSTaskDelHook(

9、)OS_CPU_HOOKS_ENN/AOSTaskStatHook()OS_CPU_HOOKS_ENN/AOSTaskSwHook()OS_CPU_HOOKS_ENN/AOSTimeTickHook()OS_CPU_HOOKS_ENN/ATable 12-1b OS_MAX_EVENTS OS_MAX_EVENTS OS_MAX_EVENTS specifies the maximum number of event control blocks that will be allocated. An event control block is needed for every message

10、 mailbox, message queue or semaphore object. For example, if you have 10 mailboxes, 5 queues and 3 semaphores, you must set OS_MAX_EVENTS to at least 18. If you intend to use either mailboxes, queues and/or semaphores then you MUST set OS_MAX_EVENTS to at least 2. OS_MAX_MEM_PART OS_MAX_MEM_PART OS_

11、MAX_MEM_PART specifies the maximum number of memory partitions that will be managed by the memory partition manager found in OS_MEM.C. To use memory partition, however, you will also need to set OS_MEM_EN to 1. If you intend to use memory partitions then you MUST set OS_MAX_MEM_PART to at least 2. O

12、S_MAX_QS OS_MAX_QS OS_MAX_QS specifies the maximum number of message queues that your application will create. To use message queue services, you will also need to set OS_Q_EN to 1. If you intend to use message queues then you MUST set OS_MAX_QS to at least 2. OS_MAX_TASKS OS_MAX_TASKS OS_MAX_TASKS

13、specifies the maximum number of application tasks that can exist in your application. Note that OS_MAX_TASKS cannot be greater than 62 because C/OS-II reserves two tasks for itself (see OS_N_SYS_TASKS in uCOS_II.H). If you set OS_MAX_TASKS to the exact number of tasks in your system, you will need t

14、o make sure that you revise this value when you add additional tasks. Conversely, if you make OS_MAX_TASKS much higher than your current task requirements (for future expansion), you will be wasting valuable RAM. OS_LOWEST_PRIO OS_LOWEST_PRIO OS_LOWEST_PRIO specifies the lowest task priority (i.e. h

15、ighest number) that you intend to use in your application and is provided to allow you to reduce the amount of RAM needed by C/OS-II. Remember that C/OS-IIs priorities can go from 0 (highest priority) to a maximum of 63 (lowest possible priority). Setting OS_LOWEST_PRIO to a value less than 63 means

16、 that your application cannot create tasks with a priority number higher than OS_LOWEST_PRIO. In fact, C/OS-II reserves priorities OS_LOWEST_PRIO and OS_LOWEST_PRIO 1 for itself. Task of priority OS_LOWEST_PRIO is reserved for the idle task (OSTaskIdle() while priority OS_LOWEST_PRIO 1 is reserved for the statistic task (OSTaskStat(). The priorities of your application tasks can thus take a value between 0 and OS_LOWEST_PRIO 2 (in

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 商业/管理/HR > 经营企划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号