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

Method set

libraries/NibbleArray/nibbleArray.cpp:44–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42
43
44uint8_t nibbleArray::set(const uint16_t index, uint8_t value)
45{
46 if (index > _size)
47 {
48 return NIBBLEARRAY_ERROR_INDEX; // disable this check for more speed
49 }
50 uint8_t v = value & 0x0F;
51 if (index & 1) _arr[index/2] = (_arr[index/2] & 0xF0) | v;
52 else _arr[index/2] = (_arr[index/2] & 0x0F) | (v << 4);
53 return NIBBLEARRAY_OK;
54}
55
56
57void nibbleArray::clear()

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36