Versions Compared

Key

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

...

Description

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

Files

os.h/os_core.c

Prototype

Code Block
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_quantaanchor10027581002758

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.

...

1002759p_erranchor10027601002760

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

...

classWebWorks_Indent_1

...

OS_ERR_NONE

...

classWebWorks_Indent_2

...

If the call is successful.

...

Returned Value

anchorNone10027641002764 None Anchor10027651002765

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

Anchor10027661002766None Anchor10028141002814

Example Usage

...

Code Block

...

void main (void) { OS_ERR err;     : OSInit(&err); /* Initialize µC/OS-III */ : : OSSchedRoundRobinCfg(DEF_ENABLED, 10, &err); /* Check “err” */ : : OSStart(&err); /* Start Multitasking */ }tr
HTML Table
summary
classCode_Listing
Table Row (tr)
Table Cell (td)
rowspan15
Anchor
10027691002769
Anchor
10027701002770
Anchor
10027711002771
Anchor
10027721002772
Anchor
10027731002773
Anchor
10027741002774
Anchor
10027751002775
Anchor
10027761002776
Anchor
10027771002777
Anchor
10027781002778
Anchor
10027791002779
Anchor
10027801002780
Anchor
10027811002781
Anchor
10027821002782
Anchor
10027831002783
Anchor
10027841002784
Anchor
10027851002785
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
titleOSSchedRoundRobinCfg() 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              */
          }