Difference between revisions of "OCEOS/oceos kernel/initialisation"
Okhoruzhyy (talk | contribs) |
Okhoruzhyy (talk | contribs) |
||
Line 35: | Line 35: | ||
===<span style="color:#0000ff">oceos_init()</span>=== | ===<span style="color:#0000ff">oceos_init()</span>=== | ||
<span style="color:#0000ff">'''Header'''</span><br> | <span style="color:#0000ff">'''Header'''</span><br> | ||
Revision as of 16:58, 11 March 2022
OCEOS Initialization
Introduction
This section describes the OCEOS directives used to in most applications.
The application code (starting at main()) will typically carry out various system self test and initialization routines and set up interrupt/trap handlers, and then use OCEOS
The calls to get OCEOS running are:
- oceos_init - Uses oceos_init to Initialize fixed data and start system time and log
- oceos_task_create - Create task setting priority, maximum number of jobs, start function, etc.
- oceos_init_finish - Complete and check fixed data area
- oceos_start - Start the scheduler - will start optional initial task or put CPU in sleep mode waiting for interrupt.
The functions that implement the operations of each task are defined in the application. The start function for each task and optional task tidy up kill function are specified when a task is created.
If mutexes, semaphores, data queues and/or timed actions are required they also are created at step 2.
Note
It is mandatory to create the number of tasks, mutexes, semaphores, and data queues declared in oceos_config.h otherwise oceos_init_finish() will return an error.
In OCEOS all task, mutex and other names are unsigned integers and it is strongly recommended that enumerated types are used for this purpose, so as to provide user friendly names.
It is suggested that these names be defined in the application header that is also used for application function declarations. To avoid possible confusion between names, it is suggested also that all task names start with 't_', all mutex names with 'm_', etc.
API Functions
Directive | Description | main | task | IRQ handler |
---|---|---|---|---|
oceos_init() | Initialize fixed data | * | ||
oceos_init_finish() | Complete and check fixed data area | * | ||
oceos_start() | Start the scheduler | * |
oceos_init()
Header
Description
Prototype
Parameters
Returns
Example Usage