...
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_quanta
anchor
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
anchoris a pointer to a variable that is used to hold an error code:
...
class | WebWorks_Indent_1 |
---|
...
OS_ERR_NONE
...
class | WebWorks_Indent_2 |
---|
...
If the call is successful.
...
Returned Value
anchorNone
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
Anchor
Example Usage
...
Code Block |
---|
...
HTML Table | ||
---|---|---|
summary | ||
class | Code_Listing | |
Table Row (tr) | ||
Table Cell (td) | ||
| ||
Anchor | 1002769 | 1002769 | void main (void)
Anchor | 1002770 | 1002770 | {
Anchor | 1002771 | 1002771 | OS_ERR err;
Anchor | 1002772 | 1002772 |
Anchor | 1002773 | 1002773 |
Anchor | 1002774 | 1002774 | :
Anchor | 1002775 | 1002775 | OSInit(&err); /* Initialize µC/OS-III */
Anchor | 1002776 | 1002776 | :
Anchor | 1002777 | 1002777 | :
Anchor | 1002778 | 1002778 | OSSchedRoundRobinCfg(DEF_ENABLED,
Anchor | 1002779 | 1002779 | 10,
Anchor | 1002780 | 1002780 | &err);
Anchor | 1002781 | 1002781 | /* Check “err” */
Anchor | 1002782 | 1002782 | :
Anchor | 1002783 | 1002783 | :
Anchor | 1002784 | 1002784 | OSStart(&err); /* Start Multitasking */
Anchor | 1002785 | 1002785 | }
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) |
| |
void main (void)
{
OS_ERR err;
:
OSInit(&err); /* Initialize µC/OS-III */
:
:
OSSchedRoundRobinCfg(DEF_ENABLED,
10,
&err);
/* Check "err" */
:
:
OSStart(&err); /* Start Multitasking */
} |