MCPcopy Create free account
hub / github.com/SharpCoder/teensycore / push

Method push

src/system/buffer.rs:22–30  ·  view source on GitHub ↗
(&mut self, item: T)

Source from the content-addressed store, hash-verified

20
21impl<const SIZE: usize, T: Copy> Stack<T> for Buffer<SIZE, T> {
22 fn push(&mut self, item: T) {
23 if self.tail == (SIZE - 1) {
24 // Discard the data. we are buffer oerflow.
25 return;
26 }
27
28 self.data[self.tail] = item;
29 self.tail += 1;
30 }
31
32 fn pop(&mut self) -> Option<T> {
33 if self.tail == 0 {

Callers 15

whenMethod · 0.45
when_nanoMethod · 0.45
usb_serial_writeFunction · 0.45
write_vecMethod · 0.45
usb_attach_irq_handlerFunction · 0.45
with_descriptorMethod · 0.45
with_stringMethod · 0.45
with_interfaceMethod · 0.45
as_vectorMethod · 0.45
splitMethod · 0.45
bufferFunction · 0.45

Calls

no outgoing calls

Tested by 3

bufferFunction · 0.36
testFunction · 0.36
test2Function · 0.36