fifo 支持水位监测和溢出次数统计
This commit is contained in:
@@ -13,7 +13,12 @@
|
||||
#include <os_macros.h>
|
||||
#endif /*INCLUDED_OS_MACROS_H*/
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------ */
|
||||
/* */
|
||||
|
||||
#ifndef OS_CFG_FIFO_DEBUG_ENABLE
|
||||
#define OS_CFG_FIFO_DEBUG_ENABLE 1
|
||||
#endif
|
||||
|
||||
/* ==================================================================================================== */
|
||||
/* 类型 */
|
||||
@@ -24,6 +29,11 @@ typedef struct fifo_t{
|
||||
os_size_t buffer_size;
|
||||
volatile os_size_t write_idx;
|
||||
volatile os_size_t read_idx;
|
||||
#if defined(OS_CFG_FIFO_DEBUG_ENABLE) && (OS_CFG_FIFO_DEBUG_ENABLE==1)
|
||||
volatile os_size_t high_water; /* 顶峰时期使用的字节数 */
|
||||
volatile os_size_t overflow_count; /* 请求遇到溢出的次数 */
|
||||
#endif
|
||||
|
||||
}fifo_t;
|
||||
|
||||
#define FIFO_INVALID_POS ((os_size_t)(-1u))
|
||||
|
||||
Reference in New Issue
Block a user