diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index d213b1b3ae7ec3651660974cde2853ffe88ad15c..bb2757fda0a66d3ce2e841f04acba08027d58530 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -13,6 +13,7 @@ * - Library Applications: * - Added new incomplete MIDIToneGenerator project * - Added ability to write protect Mass Storage disk write operations from the host OS + * - Added new RingBuffer_Peek() function to the lightweight ring buffer headers * * <b>Changed:</b> * - Core: diff --git a/LUFA/ManPages/FutureChanges.txt b/LUFA/ManPages/FutureChanges.txt index aee1f1799c31bb1e2bcf3ee5c8d0d65511e379d3..7ae15aa0bbea457cd0b771c33d888605eb51b282 100644 --- a/LUFA/ManPages/FutureChanges.txt +++ b/LUFA/ManPages/FutureChanges.txt @@ -34,6 +34,7 @@ * -# Finish StandaloneProgrammer project * -# Arduino Uno compatible USB-MIDI, USB-HID * -# Make Webserver project work in RNDIS device mode + * -# Make rescue clock always active on U4, U6 and U7 targets in AVRISP-MKII Clone project * - Ports * -# AVR32 UC3B series microcontrollers * -# Atmel ARM7 series microcontrollers diff --git a/Projects/Benito/Lib/LightweightRingBuff.h b/Projects/Benito/Lib/LightweightRingBuff.h index 56da8398f115bb5854bc95de1c044347180de7ab..cddf97f6ae6efc08014f36ea39e672e6e8b1acb3 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 56da8398f115bb5854bc95de1c044347180de7ab..cddf97f6ae6efc08014f36ea39e672e6e8b1acb3 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 0205fe467b1ae7cfc780063c8abedd2a5f234fbc..b19291cafee67dca68e6c05c83e6222fe4956575 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