Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
void OSInit (OS_ERR *p_err);

File

Called from

Code enabled by

os_core.c

Startup code only

N/A

...

Description

Initializes µC/OS-III and it must be called prior to calling any other µC/OS-III function. Including OSStart() which will start multitasking. OSInit() returns as soon as an error is detected.

Files

os.h/os_core.c

Prototype

Arguments

p_err

is a pointer to an error code. Some of the error codes below are issued only if the associated feature is enabled.

...

If OS_CFG_TMR_EN is set to 1 in os_cfg.h: OSCfg_TmrTaskStkSize is less than OSCfg_StkSizeMin. The error is detected by OS_TmrInit() in os_tmr.c.

Returned Values

None

Required Configuration

None

Callers

Application.

Notes/Warnings

  1. OSInit() must be called before OSStart().
  2. OSInit() returns as soon as it detects an error in any of the sub-functions it calls. For example, if OSInit() encounters a problem initializing the task manager, an appropriate error code will be returned and OSInit() will not go any further. It is therefore important that the user checks the error code before starting multitasking.

Example Usage