基于S3C44B0(ARM7TDI)的uCOS-II移植

分析基于S3C44B0(ARM7TDI)的uCOS-II移植的移植过程,以下是uCOS-II官方文档的一部分,值得参考。

移植工程截图链接如下:

http://hi.csdn.net/attachment/201004/5/2513952_1270480658t43H.gif

 

uCOS-II官方源码包含的文件截图:

http://hi.csdn.net/attachment/201004/5/2513952_1270480854q6wh.gif

 

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) 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 .

 


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.

 

你可能感兴趣的:(基于S3C44B0(ARM7TDI)的uCOS-II移植)