Add missing function attributes to the RingBuffer driver to reduce the chances of invalid usage.
Fix duplicated LED driver functions in the Doxygen documentation.
This commit is contained in:
1 parent
c029d72b94
commit
f152ff26c7
3 files changed
+30
-20
No files matched your search
+1
-1
@@ -1 +1 @@
|
||||
<Project name="LUFA"><Folder name="Demos"><Folder name="Device"><Folder name="ClassDriver"><Folder name="AudioInput"><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.c"></File><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.h"></File><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.txt"></File><File path="Demos\Device\ClassDriver\AudioInput\Descriptors.c"></File><File path="Demos\Device\ClassDriver\AudioInput\Descriptors.h"></File><File path="Demos\Device\ClassDriver\AudioInput\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\AudioInput\makefile"></File><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.aps"></File></Folder><Folder name="AudioOutput"><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.c"></File><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.h"></File><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.txt"></File><File path="Demos\Device\ClassDriver\AudioOutput\Descriptors.c"></File><File path="Demos\Device\ClassDriver\AudioOutput\Descriptors.h"></File><File path="Demos\Device\ClassDriver\AudioOutput\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\AudioOutput\makefile"></File><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.aps"></File></Folder><Folder name="DualVirtualSerial"><File path="Demos\Device\ClassDriver\DualVirtualSerial\Descriptors.c"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\Descriptors.h"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\DualVirtualSerial.c"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\DualVirtualSerial.h"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\DualVirtualSerial.txt"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\LUFA DualVirtualSerial.inf"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\makefile"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\DualVirtualSerial.aps"></File></Folder><Folder name="GenericHID"><File path="Demos\Device\ClassDriver\GenericHID\Descriptors.c"></File><File path="Demos\Device\ClassDriver\GenericHID\Descriptors.h"></File><File path="Demos\Device\ClassDriver\GenericHID\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.c"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.h"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.txt"></File><File path="Demos\Device\ClassDriver\GenericHID\makefile"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.aps"></File></Folder><Folder name="Joystick"><File path="Demos\Device\ClassDriver\Joystick\Descriptors.c"></File><File path="Demos\Device\ClassDriver\Joystick\Descriptors.h"></File><File path="Demos\Device\ClassDriver\Joystick\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.c"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.h"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.txt"></File><File path="Demos\Device\ClassDriver\Joystick\makefile"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.aps"></File></Folder><Folder name="Keyboard"><File path="Demos\Device\ClassDriver\Keyboard\Descriptors.c"></File><File path="Demos\Device\ClassDriver\Keyboard\Descriptors.h"></File><File path="Demos\Device\ClassDriver\Keyboard\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.c"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.h"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.txt"></File><File path="Demos\Device\ClassDriver\Keyboard\makefile"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.aps"></File></Folder><Folder name="KeyboardMouse"><File path="Demos\Device\ClassDriver\KeyboardMouse\Descriptors.c"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\Descriptors.h"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.c"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.h"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.txt"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\makefile"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.aps"></File></Folder><Folder name="KeyboardMouseMultiReport"><File path="Demos\Device\ClassDriver\KeyboardMouseMultiReport\Descriptors.c"></File><File path="Demos\Device\ClassDriver\KeyboardMouseMultiReport\Descriptors.h"></File><File path="Demos\Device\ClassDriver\KeyboardMouseMultiReport\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\KeyboardMouseMultiReport\KeyboardMouseMultiReport.c"></File><File path="Demos\Device\ClassDriver\KeyboardMouseMultiReport\KeyboardMouseMultiReport.h"></File><File path="Demos\Device\ClassDriver\KeyboardMouseMultiReport\KeyboardMouseMultiReport.txt"></File><File path="Demos\DeLine truncated
|
||||
<Project name="LUFA"><Folder name="Demos"><Folder name="Device"><Folder name="ClassDriver"><Folder name="AudioInput"><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.c"></File><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.h"></File><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.txt"></File><File path="Demos\Device\ClassDriver\AudioInput\Descriptors.c"></File><File path="Demos\Device\ClassDriver\AudioInput\Descriptors.h"></File><File path="Demos\Device\ClassDriver\AudioInput\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\AudioInput\makefile"></File><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.aps"></File></Folder><Folder name="AudioOutput"><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.c"></File><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.h"></File><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.txt"></File><File path="Demos\Device\ClassDriver\AudioOutput\Descriptors.c"></File><File path="Demos\Device\ClassDriver\AudioOutput\Descriptors.h"></File><File path="Demos\Device\ClassDriver\AudioOutput\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\AudioOutput\makefile"></File><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.aps"></File></Folder><Folder name="DualVirtualSerial"><File path="Demos\Device\ClassDriver\DualVirtualSerial\Descriptors.c"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\Descriptors.h"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\DualVirtualSerial.c"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\DualVirtualSerial.h"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\DualVirtualSerial.txt"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\LUFA DualVirtualSerial.inf"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\makefile"></File><File path="Demos\Device\ClassDriver\DualVirtualSerial\DualVirtualSerial.aps"></File></Folder><Folder name="GenericHID"><File path="Demos\Device\ClassDriver\GenericHID\Descriptors.c"></File><File path="Demos\Device\ClassDriver\GenericHID\Descriptors.h"></File><File path="Demos\Device\ClassDriver\GenericHID\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.c"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.h"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.txt"></File><File path="Demos\Device\ClassDriver\GenericHID\makefile"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.aps"></File></Folder><Folder name="Joystick"><File path="Demos\Device\ClassDriver\Joystick\Descriptors.c"></File><File path="Demos\Device\ClassDriver\Joystick\Descriptors.h"></File><File path="Demos\Device\ClassDriver\Joystick\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.c"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.h"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.txt"></File><File path="Demos\Device\ClassDriver\Joystick\makefile"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.aps"></File></Folder><Folder name="Keyboard"><File path="Demos\Device\ClassDriver\Keyboard\Descriptors.c"></File><File path="Demos\Device\ClassDriver\Keyboard\Descriptors.h"></File><File path="Demos\Device\ClassDriver\Keyboard\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.c"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.h"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.txt"></File><File path="Demos\Device\ClassDriver\Keyboard\makefile"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.aps"></File></Folder><Folder name="KeyboardMouse"><File path="Demos\Device\ClassDriver\KeyboardMouse\Descriptors.c"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\Descriptors.h"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.c"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.h"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.txt"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\makefile"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.aps"></File></Folder><Folder name="KeyboardMouseMultiReport"><File path="Demos\Device\ClassDriver\KeyboardMouseMultiReport\Descriptors.c"></File><File path="Demos\Device\ClassDriver\KeyboardMouseMultiReport\Descriptors.h"></File><File path="Demos\Device\ClassDriver\KeyboardMouseMultiReport\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\KeyboardMouseMultiReport\KeyboardMouseMultiReport.c"></File><File path="Demos\Device\ClassDriver\KeyboardMouseMultiReport\KeyboardMouseMultiReport.h"></File><File path="Demos\Device\ClassDriver\KeyboardMouseMultiReport\KeyboardMouseMultiReport.txt"></File><File path="Demos\DeLine truncated
|
||||
+19
-17
@@ -109,12 +109,12 @@
|
||||
|
||||
#if (BOARD == BOARD_NONE)
|
||||
static inline void LEDs_Init(void) {};
|
||||
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) {};
|
||||
static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) {};
|
||||
static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) {};
|
||||
static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask) {};
|
||||
static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) {};
|
||||
static inline uint8_t LEDs_GetLEDs(void) { return 0; }
|
||||
static inline void LEDs_TurnOnLEDs(const uint_reg_t LEDMask) {};
|
||||
static inline void LEDs_TurnOffLEDs(const uint_reg_t LEDMask) {};
|
||||
static inline void LEDs_SetAllLEDs(const uint_reg_t LEDMask) {};
|
||||
static inline void LEDs_ChangeLEDs(const uint_reg_t LEDMask, const uint_reg_t ActiveMask) {};
|
||||
static inline void LEDs_ToggleLEDs(const uint_reg_t LEDMask) {};
|
||||
static inline uint_reg_t LEDs_GetLEDs(void) { return 0; }
|
||||
#elif (BOARD == BOARD_USBKEY)
|
||||
#include "AVR8/USBKEY/LEDs.h"
|
||||
#elif (BOARD == BOARD_STK525)
|
||||
@@ -176,20 +176,22 @@
|
||||
#endif
|
||||
|
||||
/* Preprocessor Checks: */
|
||||
#if !defined(LEDS_LED1)
|
||||
#define LEDS_LED1 0
|
||||
#endif
|
||||
#if !defined(__DOXYGEN__)
|
||||
#if !defined(LEDS_LED1)
|
||||
#define LEDS_LED1 0
|
||||
#endif
|
||||
|
||||
#if !defined(LEDS_LED2)
|
||||
#define LEDS_LED2 0
|
||||
#endif
|
||||
#if !defined(LEDS_LED2)
|
||||
#define LEDS_LED2 0
|
||||
#endif
|
||||
|
||||
#if !defined(LEDS_LED3)
|
||||
#define LEDS_LED3 0
|
||||
#endif
|
||||
#if !defined(LEDS_LED3)
|
||||
#define LEDS_LED3 0
|
||||
#endif
|
||||
|
||||
#if !defined(LEDS_LED4)
|
||||
#define LEDS_LED4 0
|
||||
#if !defined(LEDS_LED4)
|
||||
#define LEDS_LED4 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Pseudo-Functions for Doxygen: */
|
||||
|
||||
@@ -126,6 +126,8 @@
|
||||
* \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)
|
||||
{
|
||||
GCC_FORCE_POINTER_ACCESS(Buffer);
|
||||
@@ -157,6 +159,7 @@
|
||||
*
|
||||
* \return Number of bytes currently stored in the buffer.
|
||||
*/
|
||||
static inline uint16_t RingBuffer_GetCount(RingBuffer_t* const Buffer) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline uint16_t RingBuffer_GetCount(RingBuffer_t* const Buffer)
|
||||
{
|
||||
uint16_t Count;
|
||||
@@ -182,6 +185,7 @@
|
||||
*
|
||||
* \return Number of free bytes in the buffer.
|
||||
*/
|
||||
static inline uint16_t RingBuffer_GetFreeCount(RingBuffer_t* const Buffer) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline uint16_t RingBuffer_GetFreeCount(RingBuffer_t* const Buffer)
|
||||
{
|
||||
return (Buffer->Size - RingBuffer_GetCount(Buffer));
|
||||
@@ -199,6 +203,7 @@
|
||||
*
|
||||
* \return Boolean \c true if the buffer contains no free space, 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)
|
||||
{
|
||||
return (RingBuffer_GetCount(Buffer) == 0);
|
||||
@@ -212,6 +217,7 @@
|
||||
*
|
||||
* \return Boolean \c true if the buffer contains no free space, 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)
|
||||
{
|
||||
return (RingBuffer_GetCount(Buffer) == Buffer->Size);
|
||||
@@ -226,8 +232,8 @@
|
||||
* \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)
|
||||
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);
|
||||
|
||||
@@ -254,6 +260,7 @@
|
||||
*
|
||||
* \return Next data element stored in the buffer.
|
||||
*/
|
||||
static inline uint8_t RingBuffer_Remove(RingBuffer_t* Buffer) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline uint8_t RingBuffer_Remove(RingBuffer_t* Buffer)
|
||||
{
|
||||
GCC_FORCE_POINTER_ACCESS(Buffer);
|
||||
@@ -279,6 +286,7 @@
|
||||
*
|
||||
* \return Next data element stored in the buffer.
|
||||
*/
|
||||
static inline uint8_t RingBuffer_Peek(RingBuffer_t* const Buffer) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline uint8_t RingBuffer_Peek(RingBuffer_t* const Buffer)
|
||||
{
|
||||
return *Buffer->Out;
|
||||
|
||||
Reference in new issue
Block a user