NetBurner 3.3
OS Flags

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_set
  • OSFlagState() Return the current value of the flags
  • OSFlagClear() Clear the bits asserted in bits_to_clr
  • OSFlagPendAll() Wait until all of the flags indicated by mask are set
  • OSFlagPendNoWait() Check (but do not wait) if all of the flags indicated by the mask are set
  • OSFlagPendAny() Wait until any of the flags indicated by the bit mask are set
  • OSFlagPendAnyNoWait() Check (but do not wait) if any of the flags indicated by the mask are set