MCPcopy Create free account
hub / github.com/kiibohd/controller / uart_buffer_append

Function uart_buffer_append

Output/UARTOut/arm/uart_serial.c:289–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289void uart_buffer_append(char c)
290{
291 uart_buffer[uart_buffer_tail++] = c;
292 uart_buffer_items++;
293
294 // Wrap-around of tail pointer
295 if ( uart_buffer_tail >= uart_buffer_size )
296 {
297 uart_buffer_tail = 0;
298 }
299
300 // Make sure the head pointer also moves if circular buffer is overwritten
301 if ( uart_buffer_head == uart_buffer_tail )
302 {
303 uart_buffer_head++;
304 }
305
306 // Wrap-around of head pointer
307 if ( uart_buffer_head >= uart_buffer_size )
308 {
309 uart_buffer_head = 0;
310 }
311}
312
313// Get the next character, or -1 if nothing received
314int uart_serial_getchar()

Callers 1

UART0_HandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…