Re-add in old Endpoint/Pipe workaround for unordered pipes - add new ORDERED_EP_CONFI...
[pub/USBasp.git] / Projects / USBtoSerial / Lib / LightweightRingBuff.h
index 2fbc164..cddf97f 100644 (file)
@@ -3,7 +3,7 @@
      Copyright (C) Dean Camera, 2010.
 
   dean [at] fourwalledcubicle [dot] com
      Copyright (C) Dean Camera, 2010.
 
   dean [at] fourwalledcubicle [dot] com
-      www.fourwalledcubicle.com
+           www.lufa-lib.org
 */
 
 /*
 */
 
 /*
@@ -51,7 +51,7 @@
 
        /* Defines: */
                /** Size of each ring buffer, in data elements - must be between 1 and 255. */
 
        /* Defines: */
                /** Size of each ring buffer, in data elements - must be between 1 and 255. */
-               #define BUFFER_SIZE         255
+               #define BUFFER_SIZE         128
 
                /** Type of data to store into the buffer. */
                #define RingBuff_Data_t     uint8_t
 
                /** Type of data to store into the buffer. */
                #define RingBuff_Data_t     uint8_t
                        return Data;
                }
 
                        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
 
 #endif