From b67f9f366902ae62d55195f4a4be88d209fb64fe Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 12 Dec 2010 16:39:46 +0000 Subject: Added new RingBuffer_Peek() function to the lightweight ring buffer headers. --- Projects/USBtoSerial/Lib/LightweightRingBuff.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Projects/USBtoSerial') diff --git a/Projects/USBtoSerial/Lib/LightweightRingBuff.h b/Projects/USBtoSerial/Lib/LightweightRingBuff.h index 56da8398f..cddf97f6a 100644 --- a/Projects/USBtoSerial/Lib/LightweightRingBuff.h +++ b/Projects/USBtoSerial/Lib/LightweightRingBuff.h @@ -196,5 +196,16 @@ return Data; } + /** Returns the next element stored in the ring buffer, without removing it. + * + * \param[in,out] Buffer Pointer to a ring buffer structure to retrieve from + * + * \return Next data element stored in the buffer + */ + static inline RingBuff_Data_t RingBuffer_Peek(RingBuff_t* const Buffer) + { + return *Buffer->Out; + } + #endif -- cgit v1.2.3