Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

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_cfg

is a pointer to a OS_CFG structure. See Note #3 below for a description of OS_CFG. To support the old os_cfg_app.h scheme, p_cfg can be DEF_NULL if OS_CFG_COMPAT_INIT_EN is equal to DEF_ENABLED.

p_mem_seg

is a pointer to a MEM_SEG structure. This segment will be used to allocate the kernel objects. Can be DEF_NULL to allocate objects on the heap.

p_err

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

RTOS_ERR_NONE

initialization was successful.

*NEED TO COMPLETE*

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.
  3. The listing below shows the OS_CFG and OS_TASK_CFG structures. The OS_APP_CFG_???_DFLT defines in os.h contain the default values for every OS_CFG field.

Example Usage

  • No labels