Variable Name Changes

Some of the variable names in µC/OS-II are changed for µC/OS-III to be more consistent with coding conventions. Significant variables are shown in the table below.

Changes in variable naming
µC/OS-II (ucos_ii.h)µC/OS-III (os.h)Note
OSCtxSwCtrOSTaskCtxSwCtr
OSCPUUsageOSStatTaskCPUUsage(1)
OSIdleCtrOSIdleTaskCtr
OSIdleCtrMaxOSIdleTaskCtrMax
OSIntNestingOSIntNestingCtr(2)
OSPrioCurOSPrioCur
OSPrioHighRdyOSPrioHighRdy
OSRunningOSRunning
OSSchedNestingOSSchedLockNestingCtr(3)

OSSchedLockTimeMax
OSTaskCtrOSTaskQty
OSTCBCurOSTCBCurPtr(4)
OSTCBHighRdyOSTCBHighRdyPtr(4)
OSTimeOSTickCtr(5)
OSTmrTimeOSTmrTickCtr

(1) In µC/OS-II, OSCPUUsage contains the total CPU utilization in percentage format. If the CPU is busy 12% of the time, OSCPUUsage has the value 12. In µC/OS-III, the same information is provided in OSStatTaskCPUUsage. However, as of µC/OS-III V3.03.00, the resolution of OSStatTaskCPUUsage is 1/100th of a percent or, 0.00% (value is 0) to 100.00% (value is 10,000).

(2) In µC/OS-II, OSIntNesting keeps track of the number of interrupts nesting. µC/OS-III uses OSIntNestingCtr. The “Ctr” has been added to indicate that this variable is a counter.

(3)  OSSchedNesting represents the number of times OSSchedLock() is called. µC/OS-III renames this variable to OSSchedLockNestingCtr to better represent the variable’s meaning.

(4) In µC/OS-II, OSTCBCur and OSTCBHighRdy are pointers to the OS_TCB of the current task, and to the OS_TCB of the highest-priority task that is ready-to-run. In µC/OS-III, these are renamed by adding the “Ptr” to indicate that they are pointers.

(5) The internal counter of the number of ticks since power up, or the last time the variable was changed through OSTimeSet(), has been renamed to better reflect its function.


Related pages