...
Files
os.h/os_core.c
Prototype
Code Block |
---|
void OSInit (OS_ERR *p_err); |
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.
...
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.
Example Usage
Code Block | ||
---|---|---|
| ||
void main (void)
{
OS_ERR err;
:
OSInit(&err); /* Initialize µC/OS-III */
/* Check "err" */
:
:
OSStart(&err); /* Start Multitasking */
/* Check "err" */ /* Code not supposed to end up here! */
:
:
} |