Versions Compared

Key

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

...

Files

os.h/os_sem.c

Prototype

Code Block
OS_OBJ_QTY  OSSemDel (OS_SEM  *p_sem,
                      OS_OPT   opt,
                      OS_ERR  *p_err)

Arguments

p_sem

is a pointer to the semaphore.

...

  1. Use this call with care because other tasks might expect the presence of the semaphore.

Example Usage

Code Block
titleOSSemDel() example usage
          OS_SEM  SwSem;
           
           
          void Task (void *p_arg)
          {
              OS_ERR      err;
              OS_OBJ_QTY  qty;
           
           
              (void)&p_arg;
              while (DEF_ON) {
                  :
                  :
                  qty = OSSemDel(&SwSem,
                                  OS_OPT_DEL_ALWAYS,
                                 &err);
                  /* Check "err" */
                  :
                  :
              }
          }