/* Get number of items in FIFO. 
As this function only reads the read and write pointers once, this function is reentrant and thus thread and ISR save without any mutexes. In case an overflow occurred, this function return f.depth at maximum. Overflows are checked and corrected for in the read functions! */
uint16_t tu_fifo_count(tu_fifo_t *f)
/* Get number of items in FIFO. 
As this function only reads the read and write pointers once, this function is reentrant and thus thread and ISR save without any mutexes. In case an overflow occurred, this function return f.depth at maximum. Overflows are checked and corrected for in the read functions! */
uint16_t tu_fifo_count(tu_fifo_t *f)
{
  return tu_min16(_ff_count(f->depth, f->wr_idx, f->rd_idx), f->depth);
}