Versions Compared

Key

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

...

Files

os.h/os_task.c

Prototype

Code Block
OS_SEM_CTR  OSTaskSemSet (OS_TCB      *p_tcb,
                          OS_SEM_CTR   cnt;
                          OS_ERR      *p_err)

Arguments

p_tcb

is a pointer to the task’s OS_TCB to clear the signal counter. A NULL pointer indicates that the user wants to clear the caller’s signal counter.

...

  1. Do not call OSTaskSemSet() from an ISR.

Example Usage

Code Block
titleOSTaskSemSet() example usage
          OS_TCB   TaskY;
           
           
          void TaskX (void *p_arg)
          {
              OS_ERR      err;
              OS_SEM_CTR  ctr;
           
           
              while (DEF_ON) {
                  :
                  :
                  ctr = OSTaskSemSet(&TaskY,
                                      0,
                                     &err);
                  /* Check "err" */
                  :
                  :
              }
          }