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.

Description:<br />

Delay a task for a specified time.<br />

Parameters:<br />

[IN] Hour<br />

The number of hours to be delayed<br />

[IN] Minute<br />

[IN] Sec<br />

The number of minutes to be delayed<br />

The number of seconds to be delayed<br />

[IN] Millsec<br />

Returns:<br />

E_CALL,<br />

The number of milliseconds to be delayed<br />

E_INVALID_PARAMETER,<br />

E_OK,<br />

Example Usage:<br />

#include "CCRTOS.h"<br />

void TaskN (void *pdata)<br />

{<br />

StatusType result;<br />

...<br />

Called in the ISR.<br />

Parameter passed is invalid.<br />

Execute correctly.<br />

result= TimeDelay(0,0,1,0);<br />

// Delay 1 second<br />

if(result!=E_OK)<br />

{<br />

if(result==E_CALL)<br />

{<br />

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

}<br />

else if (result== E_INVALID_PARAMETER)<br />

{<br />

printf("Invalid parameter !\n");<br />

}<br />

}<br />

...<br />

}<br />

Note:<br />

If the time input is not up to snuff, return errors.<br />

61

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

Saved successfully!

Ooh no, something went wrong!