<< Previous | Next >>

OSFlagDel

OS_FLAG_GRP * OSFlagDel( OS_FLAG_GRP * pgrp, INT8U opt, INT8U * err);

Description

This function deletes an event flag group and readies all tasks pending on the event flag group. Note that:

  • This function must be used with care. Tasks that would normally expect the presence of the event flag group must check the return code of OSFlagAccept() and OSFlagPend().

  • This call can potentially disable interrupts for a long time. The interrupt disable time is directly proportional to the number of tasks waiting on the event flag group.

Parameters

pgrp
Pointer to the desired event flag group.

opt
May be one of the following delete options:

  • OS_DEL_NO_PEND - Deletes the event flag group only if no task pending

  • OS_DEL_ALWAYS - Deletes the event flag group even if tasks are waiting. In this case, all the tasks pending will be readied..

err
Pointer to an error code. May be one of the following values:

  • OS_NO_ERR - Success, the event flag group was deleted

  • OS_ERR_DEL_ISR - If you attempted to delete the event flag group from an ISR

  • OS_FLAG_INVALID_PGRP - If pgrp is a null pointer.

  • OS_ERR_EVENT_TYPE - You are not pointing to an event flag group

  • OS_ERR_EVENT_TYPE - If you didn't pass a pointer to an event flag group

  • OS_ERR_INVALID_OPT - Invalid option was specified

  • OS_ERR_TASK_WAITING - One or more tasks were waiting on the event flag group.

Return value

pevent
Error.

(OS_EVENT *)0
Semaphore was successfully deleted.

Library

OS_FLAG.C (Prior to DC 8:UCOS2.LIB)


Dynamic C Functions << Previous | Next >> rabbit.com