Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Current »

If enabled, OS_IdleTask() is the very first task created by µC/OS-III. The priority of the idle task is always set to OS_CFG_PRIO_MAX-1. In fact, OS_IdleTask() is the only task that is ever allowed to be at this priority and, as a safeguard, when other tasks are created, OSTaskCreate() ensures that there are no other tasks created at the same priority as the idle task. The idle task runs whenever there are no other tasks that are ready-to-run.

If RAM space is tight, the idle task can be removed. This allows the user to save some data space since there is no need to have a stack for the idle task. However, even if there is not an actual task running at priority OS_CFG_PRIO_MAX-1, the user cannot create a task at that priority level. The level is still used to determine when to idle the CPU.

The important portions of the code for the idle task are shown below (refer to os_core.c for the complete code). These portions are still executed even if the idle task is disabled in os_cfg.h.

  • No labels