| 47 | |
| 48 | |
| 49 | uint8_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 | |
| 61 | uint8_t BoolArray::toggle(const uint16_t index) |