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/XPLAINBridge/Lib/LightweightRingBuff.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Projects/XPLAINBridge') diff --git a/Projects/XPLAINBridge/Lib/LightweightRingBuff.h b/Projects/XPLAINBridge/Lib/LightweightRingBuff.h index 0205fe467..b19291caf 100644 --- a/Projects/XPLAINBridge/Lib/LightweightRingBuff.h +++ b/Projects/XPLAINBridge/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