unsigned int fifo_in(fifo_t *fifo, const uint8_t *buf, unsigned long len) { unsigned int l; l = fifo_unused(fifo); if (len > l) len = l; fifo_copy_in(fifo, buf, len, fifo->in); fifo->in += len; return len; }
uint32_t fifo_in(struct k_fifo *fifo, const void *buf, uint32_t len) { uint32_t l; CPSR_ALLOC(); RHINO_CRITICAL_ENTER(); l = fifo_unused(fifo); if (len > l) { len = l; } fifo_copy_in(fifo, buf, len, fifo->in); fifo->in += len; fifo->free_bytes -= len; RHINO_CRITICAL_EXIT(); return len; }
/** * fifo_capacity - returns the number free space for new elements * @fifo: address of the fifo to be used */ unsigned int fifo_free(fifo_t * fifo) { return fifo_unused(fifo); }