aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/USBtoSerial
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-12-12 16:39:46 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-12-12 16:39:46 +0000
commitb67f9f366902ae62d55195f4a4be88d209fb64fe (patch)
tree1d7976e1f34b2b4d578fd924ca418a0d8dd1ec82 /Projects/USBtoSerial
parent8a7351c760b30077f562795500d88908e4da1932 (diff)
downloadlufa-b67f9f366902ae62d55195f4a4be88d209fb64fe.tar.gz
lufa-b67f9f366902ae62d55195f4a4be88d209fb64fe.tar.bz2
lufa-b67f9f366902ae62d55195f4a4be88d209fb64fe.zip
Added new RingBuffer_Peek() function to the lightweight ring buffer headers.
Diffstat (limited to 'Projects/USBtoSerial')
-rw-r--r--Projects/USBtoSerial/Lib/LightweightRingBuff.h11
1 files changed, 11 insertions, 0 deletions
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