From feac915c1e029e1e3a72cfe25d6953d68d383a84 Mon Sep 17 00:00:00 2001 From: Chong Liu Date: Sat, 27 Jan 2024 12:01:52 +0800 Subject: [PATCH] *p_byte --- F01_Common_Functions/inc/common_ring_buffer.h | 4 ++-- F01_Common_Functions/src/common_ring_buffer.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/F01_Common_Functions/inc/common_ring_buffer.h b/F01_Common_Functions/inc/common_ring_buffer.h index 422740e9..a8f05bbc 100644 --- a/F01_Common_Functions/inc/common_ring_buffer.h +++ b/F01_Common_Functions/inc/common_ring_buffer.h @@ -3,7 +3,7 @@ * @Author : Chong Liu * @CreateDate : 2023-10-21 14:22:20 * @LastEditors : Chong Liu - * @LastEditTime : 2024-01-27 12:01:17 + * @LastEditTime : 2024-01-27 12:01:47 * ================================================================================= * Copyright (c) 2023 by Chong Liu, All Rights Reserved. * ================================================================================= @@ -34,7 +34,7 @@ typedef struct { /**********************************************************************************/ int16_t RingBuffer_Init(RingBuffer *p_ring, uint8_t *p_buff, int16_t buff_len); /* Initialize a ring buffer */ int16_t RingBuffer_AddByte(RingBuffer *p_ring, uint8_t byte); /* Add a byte to the ring buffer */ -int16_t RingBuffer_GetByte(RingBuffer *p_ring, uint8_t *pByte); /* Get a byte from the ring buffer */ +int16_t RingBuffer_GetByte(RingBuffer *p_ring, uint8_t *p_byte); /* Get a byte from the ring buffer */ /**********************************************************************************/ /* */ diff --git a/F01_Common_Functions/src/common_ring_buffer.c b/F01_Common_Functions/src/common_ring_buffer.c index b440860b..2e991820 100644 --- a/F01_Common_Functions/src/common_ring_buffer.c +++ b/F01_Common_Functions/src/common_ring_buffer.c @@ -74,10 +74,10 @@ int16_t RingBuffer_AddByte(RingBuffer *p_ring, uint8_t byte) { * @description: 从环形 buffer 中取出一个字节 * ================================================================================= * @param {RingBuffer} *p_ring - * @param {uint8_t} *pByte + * @param {uint8_t} *p_byte * @return {int16_t} */ -int16_t RingBuffer_GetByte(RingBuffer *p_ring, uint8_t *pByte) { +int16_t RingBuffer_GetByte(RingBuffer *p_ring, uint8_t *p_byte) { /* 指针空检验 */ RETURN_ERR_IF(pRing == NULL); RETURN_ERR_IF(pByte == NULL); @@ -88,7 +88,7 @@ int16_t RingBuffer_GetByte(RingBuffer *p_ring, uint8_t *pByte) { } /* 取出一个字节 */ - *pByte = pRing->pBuff[pRing->data_idx]; + *p_byte = pRing->pBuff[pRing->data_idx]; pRing->data_idx++; /* 当idx越界时归零 */