int ring_buffer_append(struct RingBuffer *ring_buffer, char value) { if (ring_buffer_full(ring_buffer)) { return -1; } ring_buffer->buffer[ring_buffer->tail++] = value; ring_buffer->tail %= ring_buffer->size; return 0; }
SEXP R_ring_buffer_full(SEXP extPtr) { return ScalarLogical(ring_buffer_full(ring_buffer_get(extPtr, 1))); }
bool_t usart0_tx_buffer_full(void) { return ring_buffer_full(&usart0_tx_ring_buffer); }