OSFlags enables a function or task to pend on multiple flags or events, in contrast to a OSSemaphore which which can pend on only a single event. The OSFlag implementation is essentially a 32-bit bitmap in which each bit position represents a “flag”. You create a OSFlag
object with OSFlagCreate()
, then set, clean and read the flags with the appropriate function. There are a number of functions used to monitor or pend on the flags, and provide the ability to pend on any one or more of the flags being set, or pending on all of flags being set at one time.
Flag Functions
OSFlagSet()
Set the bits asserted with bits_to_setOSFlagState()
Return the current value of the flagsOSFlagClear()
Clear the bits asserted in bits_to_clrOSFlagPendAll()
Wait until all of the flags indicated by mask are setOSFlagPendNoWait()
Check (but do not wait) if all of the flags indicated by the mask are setOSFlagPendAny()
Wait until any of the flags indicated by the bit mask are setOSFlagPendAnyNoWait()
Check (but do not wait) if any of the flags indicated by the mask are set