MCPcopy Create free account
hub / github.com/OpenEarable/open-earable / reset

Method reset

src/utils/CircularBlockBuffer.cpp:48–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void 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
68uint8_t * const CircularBlockBuffer::getWritePointer(int n) {
69 return &(_buffer[positiveOffset(_writeBlock, n) * _blockSize]);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected