mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-23 00:40:12 +00:00
fix int conversion warnings
This commit is contained in:
parent
ce064de6fd
commit
04a5c03ea8
@ -82,7 +82,7 @@ bool tu_fifo_config(tu_fifo_t *f, void* buffer, uint16_t depth, uint16_t item_si
|
|||||||
// but limits the maximum depth to 2^16/2 = 2^15 and buffer overflows are detectable
|
// 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)
|
// only if overflow happens once (important for unsupervised DMA applications)
|
||||||
//f->max_pointer_idx = (uint16_t) (2*depth - 1);
|
//f->max_pointer_idx = (uint16_t) (2*depth - 1);
|
||||||
f->non_used_index_space = UINT16_MAX - (2*f->depth-1);
|
f->non_used_index_space = (uint16_t) (UINT16_MAX - (2*f->depth-1));
|
||||||
|
|
||||||
f->rd_idx = f->wr_idx = 0;
|
f->rd_idx = f->wr_idx = 0;
|
||||||
|
|
||||||
@ -867,7 +867,7 @@ bool tu_fifo_clear(tu_fifo_t *f)
|
|||||||
|
|
||||||
f->rd_idx = f->wr_idx = 0;
|
f->rd_idx = f->wr_idx = 0;
|
||||||
//f->max_pointer_idx = (uint16_t) (2*f->depth-1);
|
//f->max_pointer_idx = (uint16_t) (2*f->depth-1);
|
||||||
f->non_used_index_space = UINT16_MAX - (2*f->depth-1);
|
f->non_used_index_space = (uint16_t) (UINT16_MAX - (2*f->depth-1));
|
||||||
|
|
||||||
_ff_unlock(f->mutex_wr);
|
_ff_unlock(f->mutex_wr);
|
||||||
_ff_unlock(f->mutex_rd);
|
_ff_unlock(f->mutex_rd);
|
||||||
|
@ -136,13 +136,13 @@ typedef struct
|
|||||||
void * ptr_wrap ; ///< wrapped part start pointer
|
void * ptr_wrap ; ///< wrapped part start pointer
|
||||||
} tu_fifo_buffer_info_t;
|
} tu_fifo_buffer_info_t;
|
||||||
|
|
||||||
#define TU_FIFO_INIT(_buffer, _depth, _type, _overwritable) \
|
#define TU_FIFO_INIT(_buffer, _depth, _type, _overwritable) \
|
||||||
{ \
|
{ \
|
||||||
.buffer = _buffer, \
|
.buffer = _buffer, \
|
||||||
.depth = _depth, \
|
.depth = _depth, \
|
||||||
.item_size = sizeof(_type), \
|
.item_size = sizeof(_type), \
|
||||||
.overwritable = _overwritable, \
|
.overwritable = _overwritable, \
|
||||||
.non_used_index_space = UINT16_MAX - (2*(_depth)-1), \
|
.non_used_index_space = (uint16_t)(UINT16_MAX - (2*(_depth)-1)), \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TU_FIFO_DEF(_name, _depth, _type, _overwritable) \
|
#define TU_FIFO_DEF(_name, _depth, _type, _overwritable) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user