Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Sets the appropriate bits in a value according to a specified bit mask.

Files

lib_def.h

Prototype

          DEF_BIT_SET(val, mask);

Arguments

val

Value to modify by setting the specified bits.

mask

Mask of bits to set in the value.

Returned Value

Modified value with specified bits set.

Required Configuration

None.

Notes / Warnings

val and mask should be unsigned integers.

Example Usage

          CPU_INT16U  flags;
          CPU_INT16U  flags_alarm;
          CPU_INT32U  events;
           
          flags       = Get current flags;
          flags_alarm = DEF_BIT_00 | DEF_BIT_03;
          DEF_BIT_SET(flags, flags_alarm);
          DEF_BIT_SET_32(events, flags);
  • No labels