Versions Compared

Key

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

...

Files

os.h/os_time.c

Prototype

Code Block
void  OSTimeSet (OS_TICK   ticks,
                 OS_ERR   *p_err)

Arguments

ticks

is the desired value for the system clock, in ticks.

...

  1. You should be careful when using this function because other tasks may depend on the current value of the tick counter (OSTickCtr). Specifically, a task may delay itself (see OSTimeDly() and specify to wake up when OSTickCtr reaches a specific value.

Example Usage

 

...

Code Block
titleOSTimeSet() example usage
          void TaskX (void *p_arg)
          {
              OS_ERR  err;
           
           
              while (DEF_ON) {
                  :
                  :
                  OSTimeSet(0,
                            &err);        /* Reset the system clock  */
                  /* Check "err" */
                  :
                  :
              }
          }