diff options
| author | hathach <[email protected]> | 2018-03-08 11:42:28 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-08 11:42:28 +0700 |
| commit | 817f23e5e0f976814dfa0b5ccfa1f9f5cd1c3885 (patch) | |
| tree | 80ed4682ad3770c22c4677aae19cc004a8091256 /tinyusb/common/fifo.c | |
| parent | d28e7e3966bd4ac471b667c73d2cb1451808e641 (diff) | |
enhance
- add ASSERT_
- rename edpt_equal
-
Diffstat (limited to 'tinyusb/common/fifo.c')
| -rw-r--r-- | tinyusb/common/fifo.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tinyusb/common/fifo.c b/tinyusb/common/fifo.c index 8db3f04ac..397514dc0 100644 --- a/tinyusb/common/fifo.c +++ b/tinyusb/common/fifo.c @@ -64,6 +64,21 @@ static inline bool fifo_initalized(fifo_t* f) }
+void fifo_config(fifo_t *f, void* buffer, uint16_t depth, uint16_t item_size, bool overwritable)
+{
+ mutex_lock_if_needed(f);
+
+ f->buffer = (uint8_t*) buffer;
+ f->depth = depth;
+ f->item_size = item_size;
+ f->overwritable = overwritable;
+
+ f->rd_idx = f->wr_idx = f->count = 0;
+
+ mutex_unlock_if_needed(f);
+}
+
+
/******************************************************************************/
/*!
@brief Read one byte out of the RX buffer.
|
