aboutsummaryrefslogtreecommitdiff
path: root/Projects
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2010-12-12 16:39:46 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2010-12-12 16:39:46 +0000
commit8fa52c48863865cc59f1eb3fa4778f6e77a1eb2d (patch)
tree1d7976e1f34b2b4d578fd924ca418a0d8dd1ec82 /Projects
parent7c558e2187ce027cb3378255c5786c5f6e164222 (diff)
Added new RingBuffer_Peek() function to the lightweight ring buffer headers.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1602 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Projects')
-rw-r--r--Projects/Benito/Lib/LightweightRingBuff.h11
-rw-r--r--Projects/USBtoSerial/Lib/LightweightRingBuff.h11
-rw-r--r--Projects/XPLAINBridge/Lib/LightweightRingBuff.h11
3 files changed, 33 insertions, 0 deletions
diff --git a/Projects/Benito/Lib/LightweightRingBuff.h b/Projects/Benito/Lib/LightweightRingBuff.h
index 56da8398..cddf97f6 100644
--- a/Projects/Benito/Lib/LightweightRingBuff.h
+++ b/Projects/Benito/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
diff --git a/Projects/USBtoSerial/Lib/LightweightRingBuff.h b/Projects/USBtoSerial/Lib/LightweightRingBuff.h
index 56da8398..cddf97f6 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
diff --git a/Projects/XPLAINBridge/Lib/LightweightRingBuff.h b/Projects/XPLAINBridge/Lib/LightweightRingBuff.h
index 0205fe46..b19291ca 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