Advanced: Creating Customized OSIs : Customizing API Definitions : General API Definitions : Task APIs

Task APIs
 
Sample Definition
Code Generated
Task Entry Function Style(nameid)
void $<nameid>(void)
Defines the style in which a Task (OS Object) function entry is generated.
This API is used when generating the code for the definition of a Task's code frame.
It defines the Task's code frame function's prototype and return type.
The code is generated in the file <module>.c
For an Activity defined to be a Task:
API Definition: void $<nameid>(void)
void T1(void)
Declare Task(nameid)
extern void $<nameid>(void);
Definition of the code for declaring a Task (OS Object).
This API is used when generating the code for declaring a Task.
The code is generated in the file type_def.h
For an Activity defined to be a Task:
API Definition: extern void $<nameid>(void);
extern void T1(void);
Define Task(nameid)
Definition of the code for defining a Task (OS Object).
This API is used when generating the code for defining a Task.
The code is generated in the file glob_dat.c
For an Activity defined to be a Task:
API Definition: DEFINE_TASK($<nameid>);
Create Task(nameid)
Definition of the code for creating a Task (OS Object).
This API is used when generating the code for creating a Task.
The code is generated in the file glob_dat.c, in the function: on_startup_code.
The function on_startup_code is called at the startup of the generated application.
For an Activity defined to be a Task:
API Definition: CREATE_TASK($nameid);
Destroy Task(nameid)
Definition of the code for destroying a Task (OS Object).
This API is used when generating the code for destroying a Task.
The code is generated in the file glob_dat.c, in the function: on_exit_code.
The function on_exit_code is called at the end of the generated application.
For an Activity defined to be a Task:
API Definition: DESTROY($nameid);
Activate Task(nameid)
Defines the code for activating a Task (OS Object)
This API is used when a Task needs to be activated.
For example, each Activity has a set of macros defined in the file macro_def.h.
On of this macro is the start_activity_<act-name> macro which, in case that the Activity is defined as a Task, includes the code for Activating the Task, defined by this API.
The definition of this API will be generated in the file <module>.c
For an Activity defined to be a Task:
API Definition: ActivateTask($nameid);
#define start_activity_T1 { cgGlobalFlags |= BITAC_T1; ctivateTask(T1); }
Enter TASK(nameid)
Defines the code for entering a Task (OS Object).
This API defines the code that is put at the beginning of the Task's code frame.
The code is generated just after the code from the API: Task/ISR Beginning Code(nameid, profileName)
The definition of this API will be generated in the file <module>.c
For an Activity defined to be a Task:
API Definition: EnteredTask($nameid);
void T1(void)
EnteredTask(T1);
Terminate Task(nameid)
Defines the code for terminating a task (OS Object).
This API defines the code that is put at the end of the Task's code frame.
The definition of this API will be generated in the file <module>.c
For an Activity defined to be a Task:
API Definition: TerminateTask($nameid);
void T1(void)
TerminateTask(T1);
Wait for Multiple Events(nameid)
Defines the code for waiting for multiple Events by a Task (OS Object).
This API defines the code for waiting on multiple Task Events.
For Tasks that have Task-Event related to them, the code will be generated in the Task's code frame, after the code for the Task's logic.
The definition of this API will be generated in the file <module>.c
For an Activity defined to be a Task:
API Definition: WaitMultipleEvent($nameid);
void T1(void)
<Tasklogic>
WaitMultipleEvent(T1);
Get Multiple Events(nameid)
Defines the code for getting multiple Events by a Task (OS Object).
This API defines the code for getting the generated Task Events for multiple Task Events.
For Tasks that have Task-Event related to them, the code of this API will be generated in the Task's code frame, after the code for the API: WaitMultipleEvent()
The definition of this API will be generated in the file <module>.c
For an Activity defined to be a Task:
API Definition: GetMultipleEvent($nameid);
void T1(void)
<Tasklogic>
WaitMultipleEvent(T1);
GetMultipleEvent(T1);
Clear Multiple Events(nameid)
Defines the code for clearing multiple Events by a Task (OS Object).
This API defines the code for clearing multiple Task Events.
For Tasks that have Task-Event related to them, the code of this API will be generated in the Task's code frame, after the code for the API: Get Multiple Events().
The definition of this API will be generated in the file <module>.c
For an Activity defined to be a Task:
API Definition: ClearMultipleEvent($nameid);
void T1(void)
<Tasklogic>
WaitMultipleEvent(T1);
GetMultipleEvent(T1);
ClearMultipleEvent(T1);
Get Task ID(nameid)
Defines the code for getting a Task (OS Object) ID.