...
Files
os.h/os_core.c
Prototype
Code Block |
---|
void OSStart (OS_ERR *p_err) |
Arguments
p_err
is a pointer to a variable used to hold an error code:
OS_ERR_FATAL_RETURN
if
If we ever return to this function.
OS_ERR_OS_NOT_INIT
µC/OS-III not initialized.
OS_ERR_OS_NO_APP_TASK
No application task created.
OS_ERR_OS_RUNNING
if
If the kernel is already running. In other words, if this function has already been called.
...
OSInit()
must be called prior to callingOSStart()
.OSStart()
should only be called once by the application code. However, if you calledOSStart()
more than once, nothing happens on the second and subsequent calls.
Example Usage
...
Code Block | ||
---|---|---|
| ||
void main (void)
{
OS_ERR err;
/* User Code */
:
OSInit(&err); /* Initialize µC/OS-III */
/* Check "err" */
: /* User Code */
:
OSStart(&err); /* Start Multitasking */
/* Any code here should NEVER be executed! */
} |