<< Previous | Next >>

OSFlagPost

OS_FLAGS OSFlagPost( OS_FLAG_GRP * pgrp, OS_FLAGS flags, INT8U opt, INT8U * err );

Description

This function is called to set or clear some bits in an event flag group. The bits to set or clear are specified by a bitmask. Warnings:

  • The execution time of this function depends on the number of tasks waiting on the event flag group.

  • The amount of time interrupts are DISABLED depends on the number of tasks waiting on the event flag group.

Parameters

pgrp
Pointer to the desired event flag group.

flags
If opt (see below) is OS_FLAG_SET, each bit that is set in flags will set the corresponding bit in the event flag group. E.g., to set bits 0, 4 and 5 you would set flags to:

0x31 (note, bit 0 is least significant bit)

If opt (see below) is OS_FLAG_CLR, each bit that is set in flags will CLEAR the corresponding bit in the event flag group. E.g., to clear bits 0, 4 and 5 you would specify flags as:

0x31 (note, bit 0 is least significant bit)

opt
Indicates whether the flags will be:

set (OS_FLAG_SET), or cleared (OS_FLAG_CLR)

err
Pointer to an error code. Valid values are:

  • OS_NO_ERR - The call was successful.

  • OS_FLAG_INVALID_PGRP - null pointer passed.

  • OS_ERR_EVENT_TYPE - Not pointing to an event flag group

  • OS_FLAG_INVALID_OPT - Invalid option specified.

Return value

The new value of the event flags bits that are still set.

Library

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


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