修改部分函数名,统一风格

This commit is contained in:
2025-08-15 21:16:20 +08:00
parent 8f95cb3ae7
commit ccc15e4719

View File

@@ -17,7 +17,7 @@
* @brief 获取 FIFO 数据起始位置 * @brief 获取 FIFO 数据起始位置
* *
*/ */
#define KFIFO_POOL_PTR(_fifo) ((uint8_t *)_fifo->pool) #define kfifo_get_pool(_fifo) ((uint8_t *)_fifo->pool)
/** /**
* @brief 获取写入位置偏移量 * @brief 获取写入位置偏移量
@@ -158,7 +158,7 @@ bool kfifo_put_byte(kfifo_t *fifo, uint8_t data) {
return false; return false;
} }
KFIFO_POOL_PTR(fifo)[kfifo_offset_in(fifo)] = data; kfifo_get_pool(fifo)[kfifo_offset_in(fifo)] = data;
fifo->in++; fifo->in++;
return true; return true;
@@ -179,7 +179,7 @@ bool kfifo_get_byte(kfifo_t *fifo, uint8_t *data) {
return false; return false;
} }
*data = KFIFO_POOL_PTR(fifo)[kfifo_offset_out(fifo)]; *data = kfifo_get_pool(fifo)[kfifo_offset_out(fifo)];
fifo->out++; fifo->out++;
return true; return true;
@@ -271,7 +271,7 @@ int kfifo_peek(kfifo_t *fifo, const uint8_t **ptr) {
return 0; return 0;
} }
*ptr = &KFIFO_POOL_PTR(fifo)[kfifo_offset_out(fifo)]; *ptr = &kfifo_get_pool(fifo)[kfifo_offset_out(fifo)];
if (kfifo_offset_in(fifo) <= kfifo_offset_out(fifo)) { if (kfifo_offset_in(fifo) <= kfifo_offset_out(fifo)) {
linear = kfifo_remain_out(fifo);// 数据在缓冲区末尾 linear = kfifo_remain_out(fifo);// 数据在缓冲区末尾
} else { } else {