| 42 | |
| 43 | |
| 44 | uint8_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 | |
| 57 | void nibbleArray::clear() |