@CHIP-RTOS C Library - RTOS API
Create and start a task which is passed parameters by system.
int RTX_Param_Task ( int far *taskID,
const TASK_PARAM_DEF far *taskdefblock );
- Output Parameter: Pointer to 16 bit storage
for the taskID, allocated by the caller
- Input Parameter: Pointer to a
TASK_PARAM_DEF type data structure
prepared by caller.
- 0, task is running, output location taskID
contains the 16 bit taskID
non-zero --> error code.
- The caller must fill in portions of the
prior to making this call.
The new task is immediately placed in the system's task ready queue. Execution begins if
the task is higher priority than any other task currently ready (including task which called
This function differs with RTX_Param_Task_Without_Run
in that the new task is released to run within this function call.
This API is identical to the RTX_Create_Task, with
one difference. The task definition data structure used here allows a 32 bit
parameter to specified which the system passes to the task on the stack. Any of
the following would be valid prototypes for your task:
void huge My_TaskA(unsigned short Param1,
unsigned short Param2) ;
void huge My_TaskB(unsigned short Param1) ;
void huge My_TaskC(void far *this_object) ;
void huge My_TaskD(void near *this_object) ;
Each of these tasks, except for My_TaskA
, would need to be cast
to type PARAM_TASK
when assigned to the proc
member of the
For My_TaskC case, the following settings for Param1
members in the TASK_PARAM_DEF
structure would be required so that the far pointer this_object
would point to My_Object
Task_Def.Param1 = FP_OFF(&My_Object) ;
Task_Def.Param2 = FP_SEG(&My_Object) ;
For My_TaskD case, the pointer to the near My_Object
can be set using
only the first 16 bit parameter as follows:
Task_Def.Param1 = (unsigned short)((void near *)&My_Object) ;
In the case where your task only uses a single 16 bit parameter, the system has
pushed the second parameter onto the stack as well but it is of no consequence
to your task.
- This library function invokes a RTOS software interrupt.
Refer to this RTOS API function's
for more details.
- IPC@CHIP® System Tasks
- RTX API Overview
Supported since or modified in @CHIP-RTOS version
Supported by @CHIP-RTOS C Library since version
This API List
List of C Libraries
@CHIP-RTOS Main Index
End of document