Convention Changes
There are a number of convention changes from µC/OS-II to µC/OS-III. The most notable is the use of CPU-specific data types. The table below shows the differences between the data types used in both kernels.
µC/OS-II ( | µC/CPU ( | Note |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| (1) |
|
| (2) |
|
| (3) |
(1) A task stack in µC/OS-II is declared as an OS_STK , which is now replaced by a CPU specific data type CPU_STK . These two data types are equivalent, except that defining the width of the CPU stack in µC/CPU makes more sense.
(2) It also makes sense to declare the CPU’s status register in µC/CPU.
(3) Stack growth (high-to-low or low-to-high memory) is declared in µC/CPU since stack growth is a CPU feature and not an OS one.
Another convention change is the use of the acronym “ CFG ” which stands for configuration. Now, all #define configuration constants and variables have the “ CFG ” or “ Cfg ” acronym in them as shown in the table below. This table shows the configuration constants that have been moved from os_cfg.h to os_cfg_app.h . This is done because µC/OS-III is configurable at the application level instead of just at compile time as with µC/OS-II.
µC/OS-II (os_cfg.h) | µC/OS-III (os_cfg_app.h) | Note |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| (1) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) The very useful OS_TICKS_PER_SEC in µC/OS-II was renamed to OS_CFG_TICK_RATE_HZ in µC/OS-III. The “ HZ ” indicates that this #define represents Hertz (i.e., ticks per second).
The table belowshows additional configuration constants added to os_cfg.h , while several µC/OS-II constants were either removed or renamed.
µC/OS-II (os_cfg.h) | µC/OS-III (os_cfg.h) | Note |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
| (1) |
|
|
|
|
| (2) |
|
|
|
|
| (3) |
|
| (3) |
|
| (3) |
|
| (3) |
|
| (3) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| (6) |
|
|
|
|
|
|
|
| (2) |
|
| (4) |
|
| (5) |
|
|
|
|
|
|
|
| (6) |
|
|
|
|
|
|
|
|
|
|
|
|
|
| (5) |
|
|
|
|
| (2) |
|
| (5) |
|
|
|
|
| (6) |
|
|
|
|
|
|
|
| (5) |
|
|
|
|
| (6) |
|
|
|
|
|
|
|
|
|
|
| (7) |
|
| (7) |
|
| (7) |
|
| (5) |
|
|
|
|
|
|
|
| (6) |
|
|
|
|
|
|
|
| (5) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| (2) |
|
|
|
|
|
|
|
| (5) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| (8) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| (2) |
|
|
|
(1) DEBUG is replaced with DBG.
(2) In µC/OS-II, all kernel objects can be assigned ASCII names after creation. In µC/OS-III, ASCII names are assigned when the object is created.