MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / set

Method set

libraries/BoolArray/BoolArray.cpp:49–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48
49uint8_t BoolArray::set(const uint16_t index, const uint8_t value)
50{
51 if (_array == NULL) return BOOLARRAY_INIT_ERROR;
52 if (index >= _size) return BOOLARRAY_SIZE_ERROR;
53 uint8_t by = index / 8;
54 uint8_t bi = index & 7;
55 if (value == 0) _array[by] &= ~_masks[bi];
56 else _array[by] |= _masks[bi];
57 return BOOLARRAY_OK;
58}
59
60
61uint8_t BoolArray::toggle(const uint16_t index)

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36