Fix incorrect whitespace.
[pub/USBasp.git] / LUFA / Drivers / Misc / RingBuffer.h
index 5b509b6..97648c8 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2014.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2014  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -18,7 +18,7 @@
   advertising or publicity pertaining to distribution of the
   software without specific, written prior permission.
 
-  The author disclaim all warranties with regard to this
+  The author disclaims all warranties with regard to this
   software, including all implied warranties of merchantability
   and fitness.  In no event shall the author be liable for any
   special, indirect or consequential damages or any damages
  *  or deletions) must not overlap. If there is possibility of two or more of the same kind of
  *  operating occurring at the same point in time, atomic (mutex) locking should be used.
  */
+
 /** \ingroup Group_MiscDrivers
  *  \defgroup Group_RingBuff Generic Byte Ring Buffer - LUFA/Drivers/Misc/RingBuffer.h
  *  \brief Lightweight ring buffer, for fast insertion/deletion of bytes.
  *
- *  \section Sec_Dependencies Module Source Dependencies
+ *  \section Sec_RingBuff_Dependencies Module Source Dependencies
  *  The following files must be built with any user project that uses this module:
  *    - None
  *
- *  \section Sec_ModDescription Module Description
+ *  \section Sec_RingBuff_ModDescription Module Description
  *  Lightweight ring buffer, for fast insertion/deletion. Multiple buffers can be created of
  *  different sizes to suit different needs.
  *
@@ -57,7 +57,7 @@
  *  or deletions) must not overlap. If there is possibility of two or more of the same kind of
  *  operating occurring at the same point in time, atomic (mutex) locking should be used.
  *
- *  \section Sec_ExampleUsage Example Usage
+ *  \section Sec_RingBuff_ExampleUsage Example Usage
  *  The following snippet is an example of how this module may be used within a typical
  *  application.
  *
                 *  \param[out] DataPtr  Pointer to a global array that will hold the data stored into the ring buffer.
                 *  \param[out] Size     Maximum number of bytes that can be stored in the underlying data array.
                 */
-               static inline void RingBuffer_InitBuffer(RingBuffer_t* Buffer, uint8_t* const DataPtr, const uint16_t Size)
-                                                        ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
-               static inline void RingBuffer_InitBuffer(RingBuffer_t* Buffer, uint8_t* const DataPtr, const uint16_t Size)
+               static inline void RingBuffer_InitBuffer(RingBuffer_t* Buffer,
+                                                        uint8_t* const DataPtr,
+                                                        const uint16_t Size) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
+               static inline void RingBuffer_InitBuffer(RingBuffer_t* Buffer,
+                                                        uint8_t* const DataPtr,
+                                                        const uint16_t Size)
                {
                        GCC_FORCE_POINTER_ACCESS(Buffer);
 
                        uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
                        GlobalInterruptDisable();
-       
+
                        Buffer->In     = DataPtr;
                        Buffer->Out    = DataPtr;
                        Buffer->Start  = &DataPtr[0];
 
                        uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
                        GlobalInterruptDisable();
-                       
+
                        Count = Buffer->Count;
 
                        SetGlobalInterruptMask(CurrentGlobalInt);
                 *
                 *  \param[in,out] Buffer  Pointer to a ring buffer structure to insert into.
                 *
-                *  \return Boolean \c true if the buffer contains no free space, false otherwise.
+                *  \return Boolean \c true if the buffer contains no free space, \c false otherwise.
                 */
                static inline bool RingBuffer_IsEmpty(RingBuffer_t* const Buffer) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(1);
                static inline bool RingBuffer_IsEmpty(RingBuffer_t* const Buffer)
                 *
                 *  \param[in,out] Buffer  Pointer to a ring buffer structure to insert into.
                 *
-                *  \return Boolean \c true if the buffer contains no free space, false otherwise.
+                *  \return Boolean \c true if the buffer contains no free space, \c false otherwise.
                 */
                static inline bool RingBuffer_IsFull(RingBuffer_t* const Buffer) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(1);
                static inline bool RingBuffer_IsFull(RingBuffer_t* const Buffer)
 
                /** Inserts an element into the ring buffer.
                 *
-                *  \note Only one execution thread (main program thread or an ISR) may insert into a single buffer
-                *        otherwise data corruption may occur. Insertion and removal may occur from different execution
-                *        threads.
+                *  \warning Only one execution thread (main program thread or an ISR) may insert into a single buffer
+                *           otherwise data corruption may occur. Insertion and removal may occur from different execution
+                *           threads.
                 *
                 *  \param[in,out] Buffer  Pointer to a ring buffer structure to insert into.
                 *  \param[in]     Data    Data element to insert into the buffer.
                 */
-               static inline void RingBuffer_Insert(RingBuffer_t* Buffer, const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1);
-               static inline void RingBuffer_Insert(RingBuffer_t* Buffer, const uint8_t Data)
+               static inline void RingBuffer_Insert(RingBuffer_t* Buffer,
+                                                    const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1);
+               static inline void RingBuffer_Insert(RingBuffer_t* Buffer,
+                                                    const uint8_t Data)
                {
                        GCC_FORCE_POINTER_ACCESS(Buffer);
 
 
                        uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
                        GlobalInterruptDisable();
-                       
+
                        Buffer->Count++;
 
                        SetGlobalInterruptMask(CurrentGlobalInt);
 
                /** Removes an element from the ring buffer.
                 *
-                *  \note Only one execution thread (main program thread or an ISR) may remove from a single buffer
-                *        otherwise data corruption may occur. Insertion and removal may occur from different execution
-                *        threads.
+                *  \warning Only one execution thread (main program thread or an ISR) may remove from a single buffer
+                *           otherwise data corruption may occur. Insertion and removal may occur from different execution
+                *           threads.
                 *
                 *  \param[in,out] Buffer  Pointer to a ring buffer structure to retrieve from.
                 *
                static inline uint8_t RingBuffer_Remove(RingBuffer_t* Buffer)
                {
                        GCC_FORCE_POINTER_ACCESS(Buffer);
-               
+
                        uint8_t Data = *Buffer->Out;
 
                        if (++Buffer->Out == Buffer->End)
 
                        uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
                        GlobalInterruptDisable();
-                       
+
                        Buffer->Count--;
 
                        SetGlobalInterruptMask(CurrentGlobalInt);