Versions Compared

Key

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

...

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.

...

  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

Code Block
titleOSInit() example usage
          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! */
              :
              :
          }