mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2026-04-28 03:08:08 +00:00
fix overflow and mute
This commit is contained in:
@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user