02.01.2015 Views

CooCox CoOS User's Guide

CooCox CoOS User's Guide

CooCox CoOS User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Function Prototype:<br />

OS_TID CoCreateTaskEx<br />

Description:<br />

(<br />

);<br />

FUNCPtr<br />

void*<br />

U8<br />

OS_STK*<br />

U16<br />

U16<br />

BOOL<br />

Create a task and return its ID.<br />

Parameters:<br />

[IN] task<br />

The function which create the task<br />

[IN] argv<br />

The parameter list of the function<br />

[IN] prio<br />

[IN] stk<br />

The priority of the task<br />

task,<br />

argv,<br />

prio,<br />

stk,<br />

The starting address of the task stack<br />

[IN] stkSz<br />

stkSz,<br />

timeSlice,<br />

isWaitting<br />

The size of the task stack(its unit is word)<br />

[IN] timeSlice<br />

The time slice that the task runs (Once 0 is transferred, set it to the<br />

default length of the system.)<br />

[IN] isWaitting<br />

Task's initial state when being created. If TRUE, task is in<br />

TASK_WAITING.<br />

Returns:<br />

Task ID, Create successfully.<br />

-1, Failed to create.<br />

Example Usage:<br />

49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!