V2.86
(2007/09/12)
This is a major release as it contains a new feature called ‘Multi-Pend’ (implemented in
OSEventPendMulti()) which allows a task to pend on multiple objects (semaphores,
mailboxes or queues). If any one of those objects is posted to, the function returns and
indicates which (or all) events posted.
Multi-pend is the only feature added in this version and a number of changes throughout
the code has been implemented in order to support this new feature.
Details on how to use OSEventPendMulti() can be found in the µC/OS-II reference
manual.
UPGRADING TO V2.86
You should follow these steps in order to upgrade from a previous version to V2.86.
Even though only Multi-Pend was added in V2.86, some of the items below are repeated
from previous versions because they are important to follow.
1) Timer Manager:
Timers MUST now be created by OSTmrCreate() before they can be used. In
V2.82, a timer was created and started when you called OSTmrStart(). Now
you MUST call OSTmrCreate() and then OSTmrStart() to create and start
the timer, respectively.
It is now your responsibility to delete a timer when it is no longer being used.
The Timer Manager user-available functions are now:
OSTmrCreate()
OSTmrDel()
OSTmrNameGet()
OSTmrRemainGet()
OSTmrStart()
OSTmrStop()
To create and start a timer, you need to call OSTmrCreate() and then
OSTmrStart(). When you are done using a timer, you can delete it by calling
OSTmrDel().
2 of 84
2) TRUE and FALSE changed to OS_TRUE and OS_FALSE:
µC/OS-II now uses and returns OS_TRUE and OS_FALSE instead of TRUE and
FALSE. If you were using TRUE and FALSE in your application you will either
need to define TRUE and FALSE yourself or change those to OS_TRUE and
OS_FALSE.
3) Create APP_CFG.H:
As of V2.81, you need to create a file called APP_CFG.H which would reside in
your project. APP_CFG.H is used to hold configuration information about your
project. Specifically, we expect that you place task priorities, task stack sizes and
other application related configuration information. The following page shows an
example of the contents of APP_CFG.H.
4) Include OS_TMR.C in your project:
As of V2.81, you need to include OS_TMR.C in your builds in order to obtain the
new services provided in OS_TMR.C and avoid compiler warnings/errors.
5) New #defines are needed in OS_CFG.H:
You will need to include the following #defines (they are found in OS_CFG_R.H,
the reference file for OS_CFG.H). See also the configuration manual:
OS_APP_HOOKS_EN
OS_EVENT_MULTI_EN
OS_TMR_EN
OS_TMR_CFG_MAX
OS_TMR_CFG_NAME_SIZE
OS_TMR_CFG_WHEEL_SIZE
OS_TMR_CFG_WHEEL_SIZE
OS_MBOX_PEND_ABORT_EN
OS_Q_PEND_ABORT_EN
OS_SEM_PEND_ABORT_EN
6) Add OS_TASK_TMR_STK_SIZE:
If you use the timer manager, you will need to define the size of the timer task
stack, i.e. OS_TASK_TMR_STK_SIZE. This is declared in your project’s
OS_CFG.H.
7) Add OS_TASK_TMR_PRIO:
If you use the timer manager, you will need to define the priority of the timer
manager task, i.e. OS_TASK_TMR_PRIO. This is declared in your project’s
APP_CFG.H.
3 of 84
8) Place prototypes in OS_CPU.H:
As of V2.81, it’s IMPORTANT that you place the prototypes for OSCtxSw(),
OSIntCtxSw() and OSStartHighRdy() in OS_CPU.H. Typically, these
functions would be prototyped as follows but, depending on the compiler, they
may need to be different:
void OSStartHighRdy(void);
void OSIntCtxSw(void);
void OSCtxSw(void);
9) Start using OS_ERR_??? as error return values:
We recommend that you start using the new #define constants for error return
values. All error return values start with OS_ERR_ for consistency.
10) OS????NameGet() and OS????NameSet() not callable from ISRs:
Since OS????NameGet() and OS????NameSet() can no longer be called
from ISRs, make sure your code didn’t make use of those in ISRs.
11) OSMutexAccept() returns a BOOLEAN:
Since OSMutexAccept() now returns a BOOLEAN make sure you change
your code accordingly.
4 of 84
CHANGES IN V2.86
os_core.c
OSEventPendMulti() was added.
Optimized OS_EventTaskRdy() and added support for multi-pend.
Optimized OS_EventTaskWait().
Removed OS_EventTOAbort() and added OS_EventTaskWaitMulti(),
OS_EventTaskRemove() and OS_EventTaskRemoveMulti().
Optimized OS_TaskStat().
os_mbox.c
Rearranged OSMboxPend() to support multi-pend.
os_mutex.c
Rearranged OSMutexPend() for consistency.
os_q.c
Rearranged OSQPend() to support multi-pend.
os_sem.c
Rearranged OSSemPend() to support multi-pend.
os_task.c
Made cosmetic changes to OSTaskChangePrio() and added support for
multi-pend.
Added support for multi-pend in OSTaskDel().
ucos_ii.h
Added support for multi-pend.
5 of 84