Versions Compared

Key

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

...

void  OSIdleTaskHook (void);

File

Called from

Code enabled by

os_cpu_c.c

...

OS_IdleTask() ONLY

...

...

N/A

Anchor10004461000446This function is called by OS_IdleTask(). Anchor10004471000447

OSIdleTaskHook() is part of the CPU port code and this function must not be called by the application code. OSIdleTaskHook() is used by the µC/OS-III port developer.

Anchor10004481000448OSIdleTaskHook() runs in the context of the idle task and thus it is important to make sure there is sufficient stack space in the idle task. OSIdleTaskHook() must not make any OS???Pend() calls, call OSTaskSuspend() or OSTimeDly???(). In other words, this function must never be allowed to make a blocking call. Anchor10004501000450

Arguments

...

None Anchor10004521000452

Returned Value

...

None Anchor10510021051002

Notes/Warnings

...

...

Example

...

The code below calls an application-specific hook that the application programmer can define. The user can simply set the value of OS_AppIdleTaskHookPtr to point to the desired hook function which in this case is assumed to be defined in os_app_hooks.c. The idle task calls OSIdleTaskHook() which in turns calls App_OS_IdleTaskHook() through OS_AppIdleTaskHookPtr.

Anchor10521381052138This feature is very useful when there is a processor that can enter low-power mode. When µC/OS-III has no other task to run, the processor can be put to sleep waiting for an interrupt to wake it up. Anchor10684781068478  

...

rowspan9

...