New HID report item macros (with HID_RI_ prefix) to allow for easy creation and editi...
[pub/USBasp.git] / LUFA / Drivers / Misc / RingBuffer.h
index d9d3a83..37e8a1b 100644 (file)
@@ -35,9 +35,9 @@
  *  different sizes to suit different needs.\r
  *\r
  *  Note that for each buffer, insertion and removal operations may occur at the same time (via\r
- *  a multithreaded ISR based system) however the same kind of operation (two or more insertions\r
+ *  a multi-threaded ISR based system) however the same kind of operation (two or more insertions\r
  *  or deletions) must not overlap. If there is possibility of two or more of the same kind of\r
- *  operating occuring at the same point in time, atomic (mutex) locking should be used.\r
+ *  operating occurring at the same point in time, atomic (mutex) locking should be used.\r
  */\r
  \r
 /** \ingroup Group_MiscDrivers\r
@@ -52,9 +52,9 @@
  *  different sizes to suit different needs.\r
  *\r
  *  Note that for each buffer, insertion and removal operations may occur at the same time (via\r
- *  a multithreaded ISR based system) however the same kind of operation (two or more insertions\r
+ *  a multi-threaded ISR based system) however the same kind of operation (two or more insertions\r
  *  or deletions) must not overlap. If there is possibility of two or more of the same kind of\r
- *  operating occuring at the same point in time, atomic (mutex) locking should be used.\r
+ *  operating occurring at the same point in time, atomic (mutex) locking should be used.\r
  *\r
  *  \section Sec_ExampleUsage Example Usage\r
  *  The following snippet is an example of how this module may be used within a typical\r
                 */\r
                static inline void RingBuffer_InitBuffer(RingBuffer_t* Buffer, uint8_t* const DataPtr, const uint16_t Size)\r
                {\r
+                       GCC_FORCE_POINTER_ACCESS(Buffer);\r
+\r
                        ATOMIC_BLOCK(ATOMIC_RESTORESTATE)\r
-                       {\r
-                               GCC_FORCE_POINTER_ACCESS(Buffer);\r
-                               \r
+                       {       \r
                                Buffer->In     = DataPtr;\r
                                Buffer->Out    = DataPtr;\r
                                Buffer->Start  = &DataPtr[0];\r
                 *\r
                 *  \param[in,out] Buffer  Pointer to a ring buffer structure to insert into.\r
                 *\r
-                *  \return Boolean true if the buffer contains no free space, false otherwise.\r
+                *  \return Boolean \c true if the buffer contains no free space, false otherwise.\r
                 */\r
                static inline bool RingBuffer_IsFull(RingBuffer_t* const Buffer)\r
                {\r
                 *\r
                 *  \param[in,out] Buffer  Pointer to a ring buffer structure to insert into.\r
                 *\r
-                *  \return Boolean true if the buffer contains no free space, false otherwise.\r
+                *  \return Boolean \c true if the buffer contains no free space, false otherwise.\r
                 */\r
                static inline bool RingBuffer_IsEmpty(RingBuffer_t* const Buffer)\r
                {\r
                 *  \param[in,out] Buffer  Pointer to a ring buffer structure to insert into.\r
                 *  \param[in]     Data    Data element to insert into the buffer.\r
                 */\r
-               static inline void RingBuffer_Insert(RingBuffer_t* const Buffer,\r
+               static inline void RingBuffer_Insert(RingBuffer_t* Buffer,\r
                                                     const uint8_t Data)\r
                {\r
+                       GCC_FORCE_POINTER_ACCESS(Buffer);\r
+\r
                        *Buffer->In = Data;\r
 \r
                        if (++Buffer->In == Buffer->End)\r
                 *\r
                 *  \return Next data element stored in the buffer.\r
                 */\r
-               static inline uint8_t RingBuffer_Remove(RingBuffer_t* const Buffer)\r
+               static inline uint8_t RingBuffer_Remove(RingBuffer_t* Buffer)\r
                {\r
+                       GCC_FORCE_POINTER_ACCESS(Buffer);\r
+               \r
                        uint8_t Data = *Buffer->Out;\r
 \r
                        if (++Buffer->Out == Buffer->End)\r