Download COMPLETE EMBEDDED SOLUTIONS

Transcript
THE CMX SCHEDULER MULTI-TASKING EXECUTIVE
OPERATING SYSTEM FUNCTIONS
K_OS_Tick_Update (Page 30)
K_OS_Enable_Interrupts (Page 32)
K_OS_Disable_Interrupts (Page 33)
The K_OS_Init function
This function is called to initialize the CMX variables, parameters and configurable
system maximums. The K_OS_Init function must be called before any other CMX
functions are called. This is done in the user’s start up code. The file containing this
function should be compiled each time you change the “CPCONFIG.H” file, which
declares the application’s maximums.
#include <csfuncs.h> /* has function prototype */
void K_OS_Init(void); /* this is the function prototype */
The K_OS_Start function
The K_OS_Start function is called to invoke the CMX operating system. Once this
function is called, the CMX operating system takes control of the CPU and determines
when tasks should run and execute. It is up to you to make sure at least one task is
READY or will become READY by using the K_Task_Start function before calling
K_OS_Start.
The K_Task_Start function call should be called within the start up code. If none of the
tasks become READY, then the CMX operating system will own all the CPU time
except to allow interrupts to execute.
This is an example of the K_OS_Start function:
Called
When you want to enter the CMX operating system.
#include <csfuncs.h> /* has function prototype */
void K_OS_Start(void); /* this is the function prototype */
Passed
Nothing.
Returned
Never returns from the CMX operating system.
K_OS_Start Example:
void main(void)
{
28