From 87b57522b2ec7e50f242cac038437f1f354cc2c7 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 6 Jul 2011 02:12:09 +0000 Subject: [PATCH] Fix improper indenting of the internal board driver dispatch headers. Slight improvements to the ADC peripheral driver example in the manual. --- LUFA/Drivers/Board/Buttons.h | 28 ++-- LUFA/Drivers/Board/Joystick.h | 28 ++-- LUFA/Drivers/Board/LEDs.h | 171 ++++++++++++------------ LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h | 7 +- 4 files changed, 119 insertions(+), 115 deletions(-) diff --git a/LUFA/Drivers/Board/Buttons.h b/LUFA/Drivers/Board/Buttons.h index 75f444d291..8d19a719f8 100644 --- a/LUFA/Drivers/Board/Buttons.h +++ b/LUFA/Drivers/Board/Buttons.h @@ -135,21 +135,21 @@ #include "Board/Buttons.h" #endif - /* Pseudo-Functions for Doxygen: */ - #if defined(__DOXYGEN__) - /** Initializes the BUTTONS driver, so that the current button position can be read. This sets the appropriate - * I/O pins to an inputs with pull-ups enabled. - * - * This must be called before any Button driver functions are used. - */ - static inline void Buttons_Init(void); + /* Pseudo-Functions for Doxygen: */ + #if defined(__DOXYGEN__) + /** Initializes the BUTTONS driver, so that the current button position can be read. This sets the appropriate + * I/O pins to an inputs with pull-ups enabled. + * + * This must be called before any Button driver functions are used. + */ + static inline void Buttons_Init(void); - /** Returns a mask indicating which board buttons are currently pressed. - * - * \return Mask indicating which board buttons are currently pressed. - */ - static inline uint_reg_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; - #endif + /** Returns a mask indicating which board buttons are currently pressed. + * + * \return Mask indicating which board buttons are currently pressed. + */ + static inline uint_reg_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; + #endif #endif diff --git a/LUFA/Drivers/Board/Joystick.h b/LUFA/Drivers/Board/Joystick.h index 7affe2ec76..0d915769b1 100644 --- a/LUFA/Drivers/Board/Joystick.h +++ b/LUFA/Drivers/Board/Joystick.h @@ -119,21 +119,21 @@ #include "Board/Joystick.h" #endif - /* Pseudo-Functions for Doxygen: */ - #if defined(__DOXYGEN__) - /** Initializes the joystick driver so that the joystick position can be read. This sets the appropriate - * I/O pins to inputs with their pull-ups enabled. - */ - static inline void Joystick_Init(void); + /* Pseudo-Functions for Doxygen: */ + #if defined(__DOXYGEN__) + /** Initializes the joystick driver so that the joystick position can be read. This sets the appropriate + * I/O pins to inputs with their pull-ups enabled. + */ + static inline void Joystick_Init(void); - /** Returns the current status of the joystick, as a mask indicating the direction the joystick is - * currently facing in (multiple bits can be set). - * - * \return Mask indicating the joystick direction - see corresponding board specific Joystick.h file - * for direction masks. - */ - static inline uint_reg_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; - #endif + /** Returns the current status of the joystick, as a mask indicating the direction the joystick is + * currently facing in (multiple bits can be set). + * + * \return Mask indicating the joystick direction - see corresponding board specific Joystick.h file + * for direction masks. + */ + static inline uint_reg_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; + #endif #endif diff --git a/LUFA/Drivers/Board/LEDs.h b/LUFA/Drivers/Board/LEDs.h index ff5d2ff7fa..1e80f8f2f8 100644 --- a/LUFA/Drivers/Board/LEDs.h +++ b/LUFA/Drivers/Board/LEDs.h @@ -105,91 +105,92 @@ #define __INCLUDE_FROM_LEDS_H /* Includes: */ - #include "../../Common/Common.h" - - #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; } - #elif (BOARD == BOARD_USBKEY) - #include "AVR8/USBKEY/LEDs.h" - #elif (BOARD == BOARD_STK525) - #include "AVR8/STK525/LEDs.h" - #elif (BOARD == BOARD_STK526) - #include "AVR8/STK526/LEDs.h" - #elif (BOARD == BOARD_RZUSBSTICK) - #include "AVR8/RZUSBSTICK/LEDs.h" - #elif (BOARD == BOARD_ATAVRUSBRF01) - #include "AVR8/ATAVRUSBRF01/LEDs.h" - #elif ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) - #include "AVR8/XPLAIN/LEDs.h" - #elif (BOARD == BOARD_BUMBLEB) - #include "AVR8/BUMBLEB/LEDs.h" - #elif (BOARD == BOARD_EVK527) - #include "AVR8/EVK527/LEDs.h" - #elif (BOARD == BOARD_TEENSY) - #include "AVR8/TEENSY/LEDs.h" - #elif (BOARD == BOARD_USBTINYMKII) - #include "AVR8/USBTINYMKII/LEDs.h" - #elif (BOARD == BOARD_BENITO) - #include "AVR8/BENITO/LEDs.h" - #elif (BOARD == BOARD_JMDBU2) - #include "AVR8/JMDBU2/LEDs.h" - #elif (BOARD == BOARD_OLIMEX162) - #include "AVR8/OLIMEX162/LEDs.h" - #elif (BOARD == BOARD_USBFOO) - #include "AVR8/USBFOO/LEDs.h" - #elif (BOARD == BOARD_UDIP) - #include "AVR8/UDIP/LEDs.h" - #elif (BOARD == BOARD_BUI) - #include "AVR8/BUI/LEDs.h" - #elif (BOARD == BOARD_UNO) - #include "AVR8/UNO/LEDs.h" - #elif (BOARD == BOARD_CULV3) - #include "AVR8/CULV3/LEDs.h" - #elif (BOARD == BOARD_BLACKCAT) - #include "AVR8/BLACKCAT/LEDs.h" - #elif (BOARD == BOARD_MAXIMUS) - #include "AVR8/MAXIMUS/LEDs.h" - #elif (BOARD == BOARD_MINIMUS) - #include "AVR8/MINIMUS/LEDs.h" - #elif (BOARD == BOARD_ADAFRUITU4) - #include "AVR8/ADAFRUITU4/LEDs.h" - #elif (BOARD == BOARD_MICROSIN162) - #include "AVR8/MICROSIN162/LEDs.h" - #elif (BOARD == BOARD_SPARKFUN8U2) - #include "AVR8/SPARKFUN8U2/LEDs.h" - #elif (BOARD == BOARD_EVK1101) - #include "UC3/EVK1101/LEDs.h" - #elif (BOARD == BOARD_TUL) - #include "AVR8/TUL/LEDs.h" - #elif (BOARD == BOARD_EVK1100) - #include "UC3/EVK1100/LEDs.h" - #elif (BOARD == BOARD_EVK1104) - #include "UC3/EVK1104/LEDs.h" - #else - #include "Board/LEDs.h" - #endif - - #if !defined(LEDS_LED1) - #define LEDS_LED1 0 - #endif - - #if !defined(LEDS_LED2) - #define LEDS_LED2 0 - #endif - - #if !defined(LEDS_LED3) - #define LEDS_LED3 0 - #endif - - #if !defined(LEDS_LED4) - #define LEDS_LED4 0 - #endif + #include "../../Common/Common.h" + + #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; } + #elif (BOARD == BOARD_USBKEY) + #include "AVR8/USBKEY/LEDs.h" + #elif (BOARD == BOARD_STK525) + #include "AVR8/STK525/LEDs.h" + #elif (BOARD == BOARD_STK526) + #include "AVR8/STK526/LEDs.h" + #elif (BOARD == BOARD_RZUSBSTICK) + #include "AVR8/RZUSBSTICK/LEDs.h" + #elif (BOARD == BOARD_ATAVRUSBRF01) + #include "AVR8/ATAVRUSBRF01/LEDs.h" + #elif ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) + #include "AVR8/XPLAIN/LEDs.h" + #elif (BOARD == BOARD_BUMBLEB) + #include "AVR8/BUMBLEB/LEDs.h" + #elif (BOARD == BOARD_EVK527) + #include "AVR8/EVK527/LEDs.h" + #elif (BOARD == BOARD_TEENSY) + #include "AVR8/TEENSY/LEDs.h" + #elif (BOARD == BOARD_USBTINYMKII) + #include "AVR8/USBTINYMKII/LEDs.h" + #elif (BOARD == BOARD_BENITO) + #include "AVR8/BENITO/LEDs.h" + #elif (BOARD == BOARD_JMDBU2) + #include "AVR8/JMDBU2/LEDs.h" + #elif (BOARD == BOARD_OLIMEX162) + #include "AVR8/OLIMEX162/LEDs.h" + #elif (BOARD == BOARD_USBFOO) + #include "AVR8/USBFOO/LEDs.h" + #elif (BOARD == BOARD_UDIP) + #include "AVR8/UDIP/LEDs.h" + #elif (BOARD == BOARD_BUI) + #include "AVR8/BUI/LEDs.h" + #elif (BOARD == BOARD_UNO) + #include "AVR8/UNO/LEDs.h" + #elif (BOARD == BOARD_CULV3) + #include "AVR8/CULV3/LEDs.h" + #elif (BOARD == BOARD_BLACKCAT) + #include "AVR8/BLACKCAT/LEDs.h" + #elif (BOARD == BOARD_MAXIMUS) + #include "AVR8/MAXIMUS/LEDs.h" + #elif (BOARD == BOARD_MINIMUS) + #include "AVR8/MINIMUS/LEDs.h" + #elif (BOARD == BOARD_ADAFRUITU4) + #include "AVR8/ADAFRUITU4/LEDs.h" + #elif (BOARD == BOARD_MICROSIN162) + #include "AVR8/MICROSIN162/LEDs.h" + #elif (BOARD == BOARD_SPARKFUN8U2) + #include "AVR8/SPARKFUN8U2/LEDs.h" + #elif (BOARD == BOARD_EVK1101) + #include "UC3/EVK1101/LEDs.h" + #elif (BOARD == BOARD_TUL) + #include "AVR8/TUL/LEDs.h" + #elif (BOARD == BOARD_EVK1100) + #include "UC3/EVK1100/LEDs.h" + #elif (BOARD == BOARD_EVK1104) + #include "UC3/EVK1104/LEDs.h" + #else + #include "Board/LEDs.h" + #endif + + /* Preprocessor Checks: */ + #if !defined(LEDS_LED1) + #define LEDS_LED1 0 + #endif + + #if !defined(LEDS_LED2) + #define LEDS_LED2 0 + #endif + + #if !defined(LEDS_LED3) + #define LEDS_LED3 0 + #endif + + #if !defined(LEDS_LED4) + #define LEDS_LED4 0 + #endif /* Pseudo-Functions for Doxygen: */ #if defined(__DOXYGEN__) diff --git a/LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h b/LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h index 7a02c613a9..437b4d1a66 100644 --- a/LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h +++ b/LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h @@ -65,8 +65,11 @@ * * // Start reading ADC channel 1 in free running (continuous conversion) mode * ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_CHANNEL1); - * while (!(ADC_IsReadingComplete())) {}; - * printf("Conversion Result: %d\r\n", ADC_GetResult()); + * for (;;) + * { + * while (!(ADC_IsReadingComplete())) {}; + * printf("Conversion Result: %d\r\n", ADC_GetResult()); + * } * \endcode * * @{