diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-12-12 16:39:46 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-12-12 16:39:46 +0000 |
commit | b67f9f366902ae62d55195f4a4be88d209fb64fe (patch) | |
tree | 1d7976e1f34b2b4d578fd924ca418a0d8dd1ec82 | |
parent | 8a7351c760b30077f562795500d88908e4da1932 (diff) | |
download | lufa-b67f9f366902ae62d55195f4a4be88d209fb64fe.tar.gz lufa-b67f9f366902ae62d55195f4a4be88d209fb64fe.tar.bz2 lufa-b67f9f366902ae62d55195f4a4be88d209fb64fe.zip |
Added new RingBuffer_Peek() function to the lightweight ring buffer headers.
-rw-r--r-- | LUFA/ManPages/ChangeLog.txt | 1 | ||||
-rw-r--r-- | LUFA/ManPages/FutureChanges.txt | 1 | ||||
-rw-r--r-- | Projects/Benito/Lib/LightweightRingBuff.h | 11 | ||||
-rw-r--r-- | Projects/USBtoSerial/Lib/LightweightRingBuff.h | 11 | ||||
-rw-r--r-- | Projects/XPLAINBridge/Lib/LightweightRingBuff.h | 11 |
5 files changed, 35 insertions, 0 deletions
diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index d213b1b3a..bb2757fda 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 aee1f1799..7ae15aa0b 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 56da8398f..cddf97f6a 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 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 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 |