02.01.2015 Views

CooCox CoOS User's Guide

CooCox CoOS User's Guide

CooCox CoOS User's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.2 Task Management<br />

6.2.1 CoCreateTask() & CoCreateTaskEx()<br />

CoCreateTask()<br />

Function Prototype:<br />

OS_TID CoCreateTask<br />

Description:<br />

(<br />

);<br />

FUNCPtr<br />

void*<br />

U8<br />

OS_STK*<br />

U16<br />

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

Parameters:<br />

[IN] task<br />

task,<br />

argv,<br />

prio,<br />

stk,<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 />

stkSz,<br />

The starting address of the task stack<br />

[IN] stkSz<br />

Returns:<br />

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

Task ID, Create successfully.<br />

-1, Failed to create.<br />

47

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

Saved successfully!

Ooh no, something went wrong!