Skip to content

Commit

Permalink
add function lf256fifo_remove
Browse files Browse the repository at this point in the history
removal function for the lf256fifo feature was missing.

Signed-off-by: Darius Berghe <[email protected]>
  • Loading branch information
buha committed May 25, 2022
1 parent 7020d46 commit 7af2e15
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/no_os_lf256fifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ bool lf256fifo_is_empty(struct lf256fifo *);
int lf256fifo_read(struct lf256fifo *, uint8_t *);
int lf256fifo_write(struct lf256fifo *, uint8_t);
void lf256fifo_flush(struct lf256fifo *);
void lf256fifo_remove(struct lf256fifo *fifo);

#endif

11 changes: 11 additions & 0 deletions util/no_os_lf256fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,14 @@ void lf256fifo_flush(struct lf256fifo *fifo)
fifo->ffilled = fifo->fempty;
}

/**
* @brief Remove the fifo
* @param fifo - pointer to fifo descriptor.
* @return void
*/
void lf256fifo_remove(struct lf256fifo *fifo)
{
if (fifo && fifo->data)
free(fifo->data);
}

0 comments on commit 7af2e15

Please sign in to comment.