void OSInit (OS_ERR *p_err);
File | Called from | Code enabled by |
---|---|---|
| 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
OSInit()
must be called beforeOSStart()
.OSInit()
returns as soon as it detects an error in any of the sub-functions it calls. For example, ifOSInit()
encounters a problem initializing the task manager, an appropriate error code will be returned andOSInit()
will not go any further. It is therefore important that the user checks the error code before starting multitasking.