OSSchedRoundRobinCfg

Description

OSSchedRoundRobinCfg() is used to enable or disable round-robin scheduling.

Files

os.h/os_core.c

Prototype

void  OSSchedRoundRobinCfg (CPU_BOOLEAN   en,
                            OS_TICK       dflt_time_quanta,
                            OS_ERR       *p_err)

Arguments

en

when set to DEF_ENABLED enables round-robin scheduling, and when set to DEF_DISABLED disables it.

dflt_time_quanta

is the default time quanta given to a task. This value is used when a task is created and you specify a value of 0 for the time quanta. In other words, if the user did not specify a non-zero for the task’s time quanta, this is the value that will be used. If passing 0 for this argument, µC/OS-III will assume a time quanta of 1/10 the tick rate. For example, if the tick rate is 1000 Hz and 0 is passed for dflt_time_quanta then, µC/OS-III will set the time quanta to 10 milliseconds.

p_err

is a pointer to a variable that is used to hold an error code:

OS_ERR_NONE

If the call is successful.

Returned Value

None

Required Configuration

OS_CFG_SCHED_ROUND_ROBIN_EN must be enabled in os_cfg.h. Refer to µC-OS-III Configuration Manual.

Callers

Application.

Notes/Warnings

None

Example Usage

OSSchedRoundRobinCfg() example usage
          void main (void)
          {
              OS_ERR  err;
           
           
              :
              OSInit(&err);                 /* Initialize µC/OS-III             */
              :  
              :
              OSSchedRoundRobinCfg(DEF_ENABLED,
                                   10,
                                   &err);    
              /* Check "err" */
              :
              :
              OSStart(&err);                /* Start Multitasking              */
          }