Versions Compared

Key

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

...

Files

os.h/os_task.c

Prototype

Code Block
void   OSTaskSuspend (OS_TCB  *p_tcb,
                      OS_ERR  *p_err)

Arguments

p_tcb

is a pointer to the TCB of the task the user is suspending. A NULL pointer indicates suspension of the calling task.

...

  1. OSTaskSuspend() and OSTaskResume() must be used in pairs.
  2. A suspended task can only be resumed by OSTaskResume().

Example Usage

Code Block
titleOSTaskSuspend() example usage
          void TaskX (void *p_arg)
          {
              OS_ERR  err;
           
              (void)&p_arg;
              while (DEF_ON) {
                  :
                  :
                  OSTaskSuspend((OS_TCB *)0,
                                &err);       /* Suspend current task                       */
                  /* Check "err" */
                  :
                  :
              }
          }