Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Resumes a task that has been delayed through a call to either OSTimeDly(), or OSTimeDlyHMSM().

Files

os.h/os_time.c

Prototype

Code Block
void  OSTimeDlyResume (OS_TCB  *p_tcb,

...


                       OS_ERR  *p_err

...

File

Called from

Code enabled by

os_time.c

Task only

OS_CFG_TIME_DLY_RESUME_EN

...

)

...

Arguments

p_tcb

is a pointer to the TCB of the task that is resuming. A NULL pointer is not valid since it would indicate that the user is attempting to resume the current task and that is not possible as the caller cannot possibly be delayed.

...

If the call was successful and the task was resumed.

OS_ERR_OS_NOT_RUNNING

If OS_CFG_INVALID_OS_CALLS_CHK_EN is set to DEF_ENABLED in os_cfg.h: if µC/OS-III is not running yet.

OS_ERR_STATE_INVALID

If the task is in an invalid state.

OS_ERR_TASK_NOT_DLY

If the task was not delayed or, you passed a NULL pointer for the TCB.

OS_ERR_TASK_SUSPENDED

If the task to resume is suspended and will remain suspended.

OS_ERR_TCB_INVALID

If OS_CFG_ARG_CHK_EN is set to DEF_ENABLED in os_cfg.h:  if 'p_tcb' is a NULL pointer

OS_ERR_TIME_DLY_RESUME_ISR

If OS_CFG_CALLED_FROM_ISR_CHK_EN set to 1 in DEF_ENABLED in os_cfg.h: if calling this function from an ISR.

Returned Value

None

Required Configuration

OS_

...

CFG_TIME_

...

DLY

...

_RESUME_EN must be enabled in os_cfg.h

...

OS_ERR_TASK_SUSPENDED

If the task to resume is suspended and will remain suspended.

Returned Value

None. Refer to µC-OS-III Configuration Manual.

Callers

Application.

Notes/Warnings

  1. Do not call this function to resume a task that is waiting for an event with timeout.

Example Usage


Code Block
titleOSTimeDlyResume() example usage
          OS_TCB  AnotherTaskTCB;
           
           
          void TaskX (void *p_arg)
          {
              OS_ERR  err;
           
           
              while (DEF_ON) {
                  :
                  OSTimeDlyResume(&AnotherTaskTCB,
                                  &err);
                  /* Check "err" */
                  :
                  :
              }
          }