summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorReinhard Panhuber <[email protected]>2021-02-17 22:08:21 +0100
committerReinhard Panhuber <[email protected]>2021-02-17 22:08:21 +0100
commitae20d111244a3928472b7e55fb64d1223ee253fd (patch)
treedecf523da40e7431555113add824dca9125bae62 /src/common
parenteee47493a336eb334fdd7f1713903e2131a86650 (diff)
parent1b849fc70a9dca3603b38828a3c37696efb1ebe0 (diff)
Merge remote-tracking branch 'upstream/master' into edpt_ISO_xfer
Conflicts: src/common/tusb_fifo.h
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_fifo.c2
-rw-r--r--src/common/tusb_fifo.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/common/tusb_fifo.c b/src/common/tusb_fifo.c
index f6def94ab..9a2e085bb 100644
--- a/src/common/tusb_fifo.c
+++ b/src/common/tusb_fifo.c
@@ -74,7 +74,7 @@ bool tu_fifo_config(tu_fifo_t *f, void* buffer, uint16_t depth, uint16_t item_si
f->overwritable = overwritable;
f->max_pointer_idx = 2*depth - 1; // Limit index space to 2*depth - this allows for a fast "modulo" calculation but limits the maximum depth to 2^16/2 = 2^15 and buffer overflows are detectable only if overflow happens once (important for unsupervised DMA applications)
- f->non_used_index_space = 0xFFFF - f->max_pointer_idx;
+ f->non_used_index_space = UINT16_MAX - f->max_pointer_idx;
f->rd_mode = f->wr_mode = TU_FIFO_COPY_INC; // Default copy mode is incrementing addresses
diff --git a/src/common/tusb_fifo.h b/src/common/tusb_fifo.h
index 833b3eead..19f120a33 100644
--- a/src/common/tusb_fifo.h
+++ b/src/common/tusb_fifo.h
@@ -97,7 +97,7 @@ typedef struct
.item_size = sizeof(_type), \
.overwritable = _overwritable, \
.max_pointer_idx = 2*_depth-1, \
- .non_used_index_space = 0xFFFF - 2*_depth-1, \
+ .non_used_index_space = UINT16_MAX - (2*_depth-1), \
.wr_mode = TU_FIFO_COPY_INC, \
.rd_mode = TU_FIFO_COPY_INC, \
}