CooCox CoOS User's Guide
CooCox CoOS User's Guide
CooCox CoOS User's Guide
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 />
...<br />
/* Create a flag with auto reset, initial state: 0 */<br />
flag = CoCreateFlag (1, 0);<br />
if (result != E_OK)<br />
{<br />
if (result == E_CREATE_FAIL)<br />
{<br />
printf("Failed to create a flag!\n");<br />
}<br />
}<br />
else<br />
{<br />
printf("Flag ID : %d \n", flag);<br />
}<br />
...<br />
}<br />
Note:<br />
None<br />
6.10.2 CoDelFlag()<br />
Function Prototype:<br />
StatusType CoDelFlag(<br />
Description:<br />
Delete a certain flag.<br />
);<br />
OS_FlagID<br />
U8<br />
Parameters:<br />
[in] id<br />
The ID of a specified flag<br />
[in] opt<br />
The deleting mode:<br />
EVENT_DEL_NO_PEND,<br />
Returns:<br />
E_INVALID_ID,<br />
EVENT_DEL_ANYWAY,<br />
E_TASK_WAITING,<br />
id,<br />
opt<br />
Delete when the waiting list is empty.<br />
Delete unconditionally.<br />
The incoming ID is invalid.<br />
The waiting list isn’t empty.<br />
108