| 46 | } |
| 47 | |
| 48 | void CircularBlockBuffer::reset() { |
| 49 | if (!_external_buffer) { |
| 50 | _buffer = (uint8_t*)realloc(_buffer, _totalSize); |
| 51 | } |
| 52 | |
| 53 | if (!_buffer) { |
| 54 | Serial.println("Reallocation failed!"); |
| 55 | } |
| 56 | |
| 57 | memset(_buffer, 0x00, _totalSize); |
| 58 | |
| 59 | _readBlock = 0; |
| 60 | _writeBlock = 0; |
| 61 | |
| 62 | _overflow_count = 0; |
| 63 | _underflow_count = 0; |
| 64 | |
| 65 | clear(); |
| 66 | } |
| 67 | |
| 68 | uint8_t * const CircularBlockBuffer::getWritePointer(int n) { |
| 69 | return &(_buffer[positiveOffset(_writeBlock, n) * _blockSize]); |
nothing calls this directly
no outgoing calls
no test coverage detected