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.

Example Usage:<br />

#include "CCRTOS.h"<br />

void TaskN (void *pdata)<br />

{<br />

}<br />

StatusType result;<br />

...<br />

result= CoTickDelay(15);<br />

if(result != E_OK)<br />

{<br />

}<br />

{<br />

if(result == E_CALL)<br />

}<br />

...<br />

// Delay 15 system ticks<br />

printf("TickDelay cannot been called in ISR !\n");<br />

Note:<br />

Once calling TickDelay(), the current task will change from the running<br />

state(TASK_RUNNING)to the waiting state (TASK_WAITING). Then it will<br />

be inserted into the delay list and delay for the specified system ticks.<br />

6.3.3 CoResetTaskDelayTick()<br />

Function Prototype:<br />

StatusType CoResetTaskDelayTick<br />

Description:<br />

(<br />

);<br />

OS_TID<br />

U32<br />

taskID,<br />

ticks<br />

Reset the delayed system ticks of the designated task.<br />

Parameters:<br />

[IN] taskID<br />

ID of the designated task<br />

[IN] ticks<br />

Returns:<br />

The delayed system ticks to be reset to<br />

E_INVALID_ID,<br />

E_NOT_IN_DELAY_LIST,<br />

E_OK,<br />

ID is invalid.<br />

The designated task isn’t in the delay list.<br />

Execute correctly.<br />

59

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

Saved successfully!

Ooh no, something went wrong!