projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor documentation adjustments to the demos, projects and bootloaders to ensure...
[pub/USBasp.git]
/
LUFA
/
Drivers
/
Misc
/
RingBuffer.h
diff --git
a/LUFA/Drivers/Misc/RingBuffer.h
b/LUFA/Drivers/Misc/RingBuffer.h
index
3c55521
..
df7e702
100644
(file)
--- a/
LUFA/Drivers/Misc/RingBuffer.h
+++ b/
LUFA/Drivers/Misc/RingBuffer.h
@@
-1,13
+1,13
@@
/*
LUFA Library
/*
LUFA Library
- Copyright (C) Dean Camera, 201
1
.
+ Copyright (C) Dean Camera, 201
2
.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 201
1
Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 201
2
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
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@
-39,7
+39,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.
*/
* 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.
/** \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.
@@
-113,7
+113,7
@@
uint8_t* Out; /**< Current retrieval location in the circular buffer. */
uint8_t* Start; /**< Pointer to the start of the buffer's underlying storage array. */
uint8_t* End; /**< Pointer to the end of the buffer's underlying storage array. */
uint8_t* Out; /**< Current retrieval location in the circular buffer. */
uint8_t* Start; /**< Pointer to the start of the buffer's underlying storage array. */
uint8_t* End; /**< Pointer to the end of the buffer's underlying storage array. */
- uint
8_t
Size; /**< Size of the buffer's underlying storage array. */
+ uint
16_t
Size; /**< Size of the buffer's underlying storage array. */
uint16_t Count; /**< Number of bytes currently stored in the buffer. */
} RingBuffer_t;
uint16_t Count; /**< Number of bytes currently stored in the buffer. */
} RingBuffer_t;
@@
-134,7
+134,7
@@
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
-
+
Buffer->In = DataPtr;
Buffer->Out = DataPtr;
Buffer->Start = &DataPtr[0];
Buffer->In = DataPtr;
Buffer->Out = DataPtr;
Buffer->Start = &DataPtr[0];
@@
-166,7
+166,7
@@
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
-
+
Count = Buffer->Count;
SetGlobalInterruptMask(CurrentGlobalInt);
Count = Buffer->Count;
SetGlobalInterruptMask(CurrentGlobalInt);
@@
-225,9
+225,9
@@
/** Inserts an element into the ring 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.
*
* \param[in,out] Buffer Pointer to a ring buffer structure to insert into.
* \param[in] Data Data element to insert into the buffer.
@@
-244,7
+244,7
@@
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
-
+
Buffer->Count++;
SetGlobalInterruptMask(CurrentGlobalInt);
Buffer->Count++;
SetGlobalInterruptMask(CurrentGlobalInt);
@@
-252,9
+252,9
@@
/** Removes an element from the ring buffer.
*
/** 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.
*
*
* \param[in,out] Buffer Pointer to a ring buffer structure to retrieve from.
*
@@
-264,7
+264,7
@@
static inline uint8_t RingBuffer_Remove(RingBuffer_t* Buffer)
{
GCC_FORCE_POINTER_ACCESS(Buffer);
static inline uint8_t RingBuffer_Remove(RingBuffer_t* Buffer)
{
GCC_FORCE_POINTER_ACCESS(Buffer);
-
+
uint8_t Data = *Buffer->Out;
if (++Buffer->Out == Buffer->End)
uint8_t Data = *Buffer->Out;
if (++Buffer->Out == Buffer->End)
@@
-272,7
+272,7
@@
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
GlobalInterruptDisable();
-
+
Buffer->Count--;
SetGlobalInterruptMask(CurrentGlobalInt);
Buffer->Count--;
SetGlobalInterruptMask(CurrentGlobalInt);