Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

OS_REG_ID  OSTaskRegGet (OS_ERR  *p_err)

File

Called from

Code enabled by

os_task.c

Task only

OS_CFG_TASK_REG_TBL_SIZE > 0

OSTaskRegGetID() allows your application to assign task register IDs dynamically. In other words, instead of using #define constants to establish a task register number (or index) into the .TaskReg[] shown below, you should always use OSTaskRegGetID(), assign the ID to a variable and use this ID when calling OSTaskRegGet() or OSTaskRegSet().

If successful, OSTaskRegGetID() will return an ID between 0 and OS_CFG_TASK_REG_TBL_SIZE-1.

Arguments

p_err

is a pointer to a variable that will contain an error code returned by this function.

OS_ERR_NONE

if the call was successful and the function returned the next available task register ID (or index).

OS_ERR_NO_MORE_ID_AVAIL

if you already called OSTaskRegGetID() OS_CFG_TASK_REG_TBL_SIZE (see os_cfg.h) times and thus there are no more IDs available to be assigned.

Returned Value

The next available task register ID or OS_CFG_TASK_REG_TBL_SIZE if all the IDs have already been assigned.

Notes/Warnings

None

Example

  • No labels