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

OS_FlagID flag;<br />

void TaskN (void *pdata)<br />

{<br />

StatusType result;<br />

...<br />

/* Waiting for a flag, time-out:20 */<br />

result = CoWaitForSingleFlag (flag, 20);<br />

if (result != E_OK)<br />

{<br />

if (result == E_INVALID_ID)<br />

{<br />

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

}<br />

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

{<br />

printf("Error call in ISR !\n");<br />

}<br />

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

{<br />

printf("Time Out !\n");<br />

}<br />

}<br />

else<br />

{<br />

/* process Flag here */<br />

}<br />

...<br />

}<br />

Note:<br />

None<br />

6.10.6 CoWaitForMultipleFlags()<br />

Function Prototype:<br />

U32 CoWaitForMultipleFlags(<br />

U32<br />

flags,<br />

U8<br />

waitType,<br />

U32<br />

timeout,<br />

StatusType* perr<br />

);<br />

113

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

Saved successfully!

Ooh no, something went wrong!