Hooks and Port API Changes
Table C-18 shows the difference in APIs used to port µC/OS-II to µC/OS-III.
µC/OS-II (OS_CPU*.C/H) | µC/OS-III (OS_CPU*.C/H) | Note |
|---|---|---|
|
| (1) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| (2) |
|
|
|
|
| (3) |
|
|
|
|
| (4) |
|
|
|
|
| (5) |
|
| (5) |
|
| (5) |
(1) µC/OS-III requires that the Board Support Package (BSP) provide a 32-bit free-running counter (from 0x00000000 to 0xFFFFFFFF and rolls back to 0x00000000 ) for the purpose of performing time measurements. When a signal is sent, or a message is posted, this counter is read and sent to the recipient. This allows the recipient to know when the message was sent. If a 32-bit free-running counter is not available, you can simulate one using a 16-bit counter but, this requires more code to keep track of overflows.
(2) µC/OS-III is able to terminate a task that returns. Recall that tasks should not return since they should be either implemented as an infinite loop, or deleted if implemented as run once.
(3) The code for OSTaskStkInit() must be changed slightly in µC/OS-III since several arguments passed to this function are different than in µC/OS-II. Instead of passing the top-of-stack as in µC/OS-II, OSTaskStkInit() is passed the base address of the task stack, as well as the size of the stack.
(4) This function is not needed in µC/OS-III.
(5) These functions are a part of os_cpu_a.asm, and should only require name changes for the following variables: