fix overflow and mute

This commit is contained in:
2026-04-14 09:36:27 +03:00
parent ad1e16cfda
commit 8631f23b53
9 changed files with 466 additions and 69 deletions

View File

@ -13,13 +13,16 @@ public:
return start == end;
}
void push(T element) {
bool push(T element) {
bool pushed = false;
noInterrupts();
if (!isFull()) {
data[end] = element;
end = (end + 1) % BufferSize;
pushed = true;
}
interrupts();
return pushed;
}
T* pop() {