diff options
Diffstat (limited to 'LUFA/Drivers')
106 files changed, 336 insertions, 79 deletions
diff --git a/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h b/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h index 008cca169..af95a894b 100644 --- a/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h +++ b/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h @@ -62,7 +62,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_BUTTONS_H)
+ #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
diff --git a/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h b/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h index 2b8075b02..2208f2e40 100644 --- a/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h +++ b/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h @@ -61,7 +61,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_LEDS_H)
+ #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
diff --git a/LUFA/Drivers/Board/BUMBLEB/Buttons.h b/LUFA/Drivers/Board/BUMBLEB/Buttons.h index 240705352..e0a5cc5a9 100644 --- a/LUFA/Drivers/Board/BUMBLEB/Buttons.h +++ b/LUFA/Drivers/Board/BUMBLEB/Buttons.h @@ -64,7 +64,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_BUTTONS_H)
+ #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
diff --git a/LUFA/Drivers/Board/BUMBLEB/Joystick.h b/LUFA/Drivers/Board/BUMBLEB/Joystick.h index 4ab98ae7f..5d57ec559 100644 --- a/LUFA/Drivers/Board/BUMBLEB/Joystick.h +++ b/LUFA/Drivers/Board/BUMBLEB/Joystick.h @@ -63,7 +63,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_JOYSTICK_H)
+ #if !defined(__INCLUDE_FROM_JOYSTICK_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
#endif
diff --git a/LUFA/Drivers/Board/BUMBLEB/LEDs.h b/LUFA/Drivers/Board/BUMBLEB/LEDs.h index 344a26e9c..549bbde62 100644 --- a/LUFA/Drivers/Board/BUMBLEB/LEDs.h +++ b/LUFA/Drivers/Board/BUMBLEB/LEDs.h @@ -63,7 +63,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_LEDS_H)
+ #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
diff --git a/LUFA/Drivers/Board/Buttons.h b/LUFA/Drivers/Board/Buttons.h index 4e7588c28..d908fd43a 100644 --- a/LUFA/Drivers/Board/Buttons.h +++ b/LUFA/Drivers/Board/Buttons.h @@ -63,6 +63,7 @@ /* Macros: */
#if !defined(__DOXYGEN__)
+ #define __INCLUDE_FROM_BUTTONS_H
#define INCLUDE_FROM_BUTTONS_H
#endif
diff --git a/LUFA/Drivers/Board/Dataflash.h b/LUFA/Drivers/Board/Dataflash.h index 0197b3e2f..762142c33 100644 --- a/LUFA/Drivers/Board/Dataflash.h +++ b/LUFA/Drivers/Board/Dataflash.h @@ -62,6 +62,7 @@ /* Macros: */
#if !defined(__DOXYGEN__)
+ #define __INCLUDE_FROM_DATAFLASH_H
#define INCLUDE_FROM_DATAFLASH_H
#endif
diff --git a/LUFA/Drivers/Board/EVK527/Buttons.h b/LUFA/Drivers/Board/EVK527/Buttons.h index cb8cdc5fd..0150fa151 100644 --- a/LUFA/Drivers/Board/EVK527/Buttons.h +++ b/LUFA/Drivers/Board/EVK527/Buttons.h @@ -68,7 +68,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_BUTTONS_H)
+ #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
diff --git a/LUFA/Drivers/Board/EVK527/Dataflash.h b/LUFA/Drivers/Board/EVK527/Dataflash.h index b6a6e25d8..25a338cec 100644 --- a/LUFA/Drivers/Board/EVK527/Dataflash.h +++ b/LUFA/Drivers/Board/EVK527/Dataflash.h @@ -54,7 +54,7 @@ #include "AT45DB321C.h"
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_DATAFLASH_H)
+ #if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif
diff --git a/LUFA/Drivers/Board/EVK527/Joystick.h b/LUFA/Drivers/Board/EVK527/Joystick.h index c9262a482..7d208ea9f 100644 --- a/LUFA/Drivers/Board/EVK527/Joystick.h +++ b/LUFA/Drivers/Board/EVK527/Joystick.h @@ -61,7 +61,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_JOYSTICK_H)
+ #if !defined(__INCLUDE_FROM_JOYSTICK_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
#endif
diff --git a/LUFA/Drivers/Board/EVK527/LEDs.h b/LUFA/Drivers/Board/EVK527/LEDs.h index a1ba50d82..ea7c7c2c7 100644 --- a/LUFA/Drivers/Board/EVK527/LEDs.h +++ b/LUFA/Drivers/Board/EVK527/LEDs.h @@ -61,7 +61,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_LEDS_H)
+ #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
diff --git a/LUFA/Drivers/Board/Joystick.h b/LUFA/Drivers/Board/Joystick.h index be9d267cc..39375a265 100644 --- a/LUFA/Drivers/Board/Joystick.h +++ b/LUFA/Drivers/Board/Joystick.h @@ -62,6 +62,7 @@ /* Macros: */
#if !defined(__DOXYGEN__)
+ #define __INCLUDE_FROM_JOYSTICK_H
#define INCLUDE_FROM_JOYSTICK_H
#endif
diff --git a/LUFA/Drivers/Board/LEDs.h b/LUFA/Drivers/Board/LEDs.h index 222be0e65..94fbf3cf7 100644 --- a/LUFA/Drivers/Board/LEDs.h +++ b/LUFA/Drivers/Board/LEDs.h @@ -70,6 +70,7 @@ /* Macros: */
#if !defined(__DOXYGEN__)
+ #define __INCLUDE_FROM_LEDS_H
#define INCLUDE_FROM_LEDS_H
#endif
diff --git a/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h b/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h index 088cd3aef..d095d6e0f 100644 --- a/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h +++ b/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h @@ -61,7 +61,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_LEDS_H)
+ #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
diff --git a/LUFA/Drivers/Board/STK525/Buttons.h b/LUFA/Drivers/Board/STK525/Buttons.h index fbf4f58c1..f3dccafd9 100644 --- a/LUFA/Drivers/Board/STK525/Buttons.h +++ b/LUFA/Drivers/Board/STK525/Buttons.h @@ -68,7 +68,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_BUTTONS_H)
+ #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
diff --git a/LUFA/Drivers/Board/STK525/Dataflash.h b/LUFA/Drivers/Board/STK525/Dataflash.h index cab1af838..f541edbb7 100644 --- a/LUFA/Drivers/Board/STK525/Dataflash.h +++ b/LUFA/Drivers/Board/STK525/Dataflash.h @@ -54,7 +54,7 @@ #include "AT45DB321C.h"
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_DATAFLASH_H)
+ #if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif
diff --git a/LUFA/Drivers/Board/STK525/Joystick.h b/LUFA/Drivers/Board/STK525/Joystick.h index 1cb270f3a..6358f957e 100644 --- a/LUFA/Drivers/Board/STK525/Joystick.h +++ b/LUFA/Drivers/Board/STK525/Joystick.h @@ -61,7 +61,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_JOYSTICK_H)
+ #if !defined(__INCLUDE_FROM_JOYSTICK_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
#endif
diff --git a/LUFA/Drivers/Board/STK525/LEDs.h b/LUFA/Drivers/Board/STK525/LEDs.h index 39ffa0f8c..b54a8c987 100644 --- a/LUFA/Drivers/Board/STK525/LEDs.h +++ b/LUFA/Drivers/Board/STK525/LEDs.h @@ -61,7 +61,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_LEDS_H)
+ #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
diff --git a/LUFA/Drivers/Board/STK526/Buttons.h b/LUFA/Drivers/Board/STK526/Buttons.h index 9aa798a6e..f480560f6 100644 --- a/LUFA/Drivers/Board/STK526/Buttons.h +++ b/LUFA/Drivers/Board/STK526/Buttons.h @@ -68,7 +68,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_BUTTONS_H)
+ #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
diff --git a/LUFA/Drivers/Board/STK526/Dataflash.h b/LUFA/Drivers/Board/STK526/Dataflash.h index ff89dce03..9d04afe4c 100644 --- a/LUFA/Drivers/Board/STK526/Dataflash.h +++ b/LUFA/Drivers/Board/STK526/Dataflash.h @@ -54,7 +54,7 @@ #include "AT45DB642D.h"
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_DATAFLASH_H)
+ #if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif
diff --git a/LUFA/Drivers/Board/STK526/Joystick.h b/LUFA/Drivers/Board/STK526/Joystick.h index a40526a6f..b095536aa 100644 --- a/LUFA/Drivers/Board/STK526/Joystick.h +++ b/LUFA/Drivers/Board/STK526/Joystick.h @@ -61,7 +61,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_JOYSTICK_H)
+ #if !defined(__INCLUDE_FROM_JOYSTICK_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
#endif
diff --git a/LUFA/Drivers/Board/STK526/LEDs.h b/LUFA/Drivers/Board/STK526/LEDs.h index 4e68d6184..d1ac493ad 100644 --- a/LUFA/Drivers/Board/STK526/LEDs.h +++ b/LUFA/Drivers/Board/STK526/LEDs.h @@ -61,7 +61,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_LEDS_H)
+ #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
diff --git a/LUFA/Drivers/Board/Temperature.h b/LUFA/Drivers/Board/Temperature.h index 86e0b66f0..7a5af367b 100644 --- a/LUFA/Drivers/Board/Temperature.h +++ b/LUFA/Drivers/Board/Temperature.h @@ -52,11 +52,6 @@ #ifndef __TEMPERATURE_H__
#define __TEMPERATURE_H__
- /* Macros: */
- #if !defined(__DOXYGEN__)
- #define INCLUDE_FROM_BOARD_DRIVER
- #endif
-
/* Includes: */
#include <avr/pgmspace.h>
diff --git a/LUFA/Drivers/Board/USBKEY/Buttons.h b/LUFA/Drivers/Board/USBKEY/Buttons.h index 606fe81f8..db1391c8e 100644 --- a/LUFA/Drivers/Board/USBKEY/Buttons.h +++ b/LUFA/Drivers/Board/USBKEY/Buttons.h @@ -62,7 +62,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_BUTTONS_H)
+ #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
diff --git a/LUFA/Drivers/Board/USBKEY/Dataflash.h b/LUFA/Drivers/Board/USBKEY/Dataflash.h index 2ada30039..96cc3ad2d 100644 --- a/LUFA/Drivers/Board/USBKEY/Dataflash.h +++ b/LUFA/Drivers/Board/USBKEY/Dataflash.h @@ -54,7 +54,7 @@ #include "AT45DB642D.h"
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_DATAFLASH_H)
+ #if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif
diff --git a/LUFA/Drivers/Board/USBKEY/Joystick.h b/LUFA/Drivers/Board/USBKEY/Joystick.h index bbb2a1663..b0829914b 100644 --- a/LUFA/Drivers/Board/USBKEY/Joystick.h +++ b/LUFA/Drivers/Board/USBKEY/Joystick.h @@ -61,7 +61,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_JOYSTICK_H)
+ #if !defined(__INCLUDE_FROM_JOYSTICK_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
#endif
diff --git a/LUFA/Drivers/Board/USBKEY/LEDs.h b/LUFA/Drivers/Board/USBKEY/LEDs.h index cccdc9390..e1a5b2314 100644 --- a/LUFA/Drivers/Board/USBKEY/LEDs.h +++ b/LUFA/Drivers/Board/USBKEY/LEDs.h @@ -61,7 +61,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_LEDS_H)
+ #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
diff --git a/LUFA/Drivers/Board/XPLAIN/Dataflash.h b/LUFA/Drivers/Board/XPLAIN/Dataflash.h index 045d596f1..a0e09c711 100644 --- a/LUFA/Drivers/Board/XPLAIN/Dataflash.h +++ b/LUFA/Drivers/Board/XPLAIN/Dataflash.h @@ -54,7 +54,7 @@ #include "AT45DB642D.h"
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_DATAFLASH_H)
+ #if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif
diff --git a/LUFA/Drivers/Board/XPLAIN/LEDs.h b/LUFA/Drivers/Board/XPLAIN/LEDs.h index 36d8315b6..add868d20 100644 --- a/LUFA/Drivers/Board/XPLAIN/LEDs.h +++ b/LUFA/Drivers/Board/XPLAIN/LEDs.h @@ -61,7 +61,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_LEDS_H)
+ #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif
diff --git a/LUFA/Drivers/Peripheral/ADC.h b/LUFA/Drivers/Peripheral/ADC.h index 1a111697b..982364368 100644 --- a/LUFA/Drivers/Peripheral/ADC.h +++ b/LUFA/Drivers/Peripheral/ADC.h @@ -54,8 +54,7 @@ /* Macros: */
#if !defined(__DOXYGEN__)
- #define INCLUDE_FROM_ADC_H
- #define INCLUDE_FROM_CHIP_DRIVER
+ #define __INCLUDE_FROM_ADC_H
#endif
/* Includes: */
diff --git a/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h b/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h index a7414ec31..8b1b47df2 100644 --- a/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h +++ b/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h @@ -62,7 +62,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_ADC_H)
+ #if !defined(__INCLUDE_FROM_ADC_H)
#error Do not include this file directly. Include LUFA/Drivers/Peripheral/ADC.h instead.
#endif
diff --git a/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h b/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h index be905fe4e..13db86e69 100644 --- a/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h +++ b/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h @@ -63,7 +63,7 @@ #endif
/* Preprocessor Checks: */
- #if !defined(INCLUDE_FROM_TWI_H)
+ #if !defined(__INCLUDE_FROM_TWI_H)
#error Do not include this file directly. Include LUFA/Drivers/Peripheral/TWI.h instead.
#endif
diff --git a/LUFA/Drivers/Peripheral/SerialStream.c b/LUFA/Drivers/Peripheral/SerialStream.c index c23d4e16a..867160a3e 100644 --- a/LUFA/Drivers/Peripheral/SerialStream.c +++ b/LUFA/Drivers/Peripheral/SerialStream.c @@ -28,7 +28,7 @@ this software.
*/
-#define INCLUDE_FROM_SERIALSTREAM_C
+#define __INCLUDE_FROM_SERIALSTREAM_C
#include "SerialStream.h"
FILE USARTStream = FDEV_SETUP_STREAM(SerialStream_TxByte, SerialStream_RxByte, _FDEV_SETUP_RW);
diff --git a/LUFA/Drivers/Peripheral/SerialStream.h b/LUFA/Drivers/Peripheral/SerialStream.h index e03ce4128..feadd0a0f 100644 --- a/LUFA/Drivers/Peripheral/SerialStream.h +++ b/LUFA/Drivers/Peripheral/SerialStream.h @@ -70,7 +70,7 @@ extern FILE USARTStream;
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_SERIALSTREAM_C)
+ #if defined(__INCLUDE_FROM_SERIALSTREAM_C)
static int SerialStream_TxByte(char DataByte, FILE *Stream) ATTR_NON_NULL_PTR_ARG(2);
static int SerialStream_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1);
#endif
diff --git a/LUFA/Drivers/Peripheral/TWI.h b/LUFA/Drivers/Peripheral/TWI.h index 7432a1691..29c0afe40 100644 --- a/LUFA/Drivers/Peripheral/TWI.h +++ b/LUFA/Drivers/Peripheral/TWI.h @@ -53,8 +53,7 @@ /* Macros: */
#if !defined(__DOXYGEN__)
- #define INCLUDE_FROM_TWI_H
- #define INCLUDE_FROM_CHIP_DRIVER
+ #define __INCLUDE_FROM_TWI_H
#endif
/* Includes: */
diff --git a/LUFA/Drivers/USB/Class/Audio.h b/LUFA/Drivers/USB/Class/Audio.h index 34e867233..c6a926337 100644 --- a/LUFA/Drivers/USB/Class/Audio.h +++ b/LUFA/Drivers/USB/Class/Audio.h @@ -49,6 +49,10 @@ #ifndef _AUDIO_CLASS_H_
#define _AUDIO_CLASS_H_
+ /* Macros: */
+ #define __INCLUDE_FROM_AUDIO_DRIVER
+ #define __INCLUDE_FROM_USB_DRIVER
+
/* Includes: */
#include "../HighLevel/USBMode.h"
diff --git a/LUFA/Drivers/USB/Class/CDC.h b/LUFA/Drivers/USB/Class/CDC.h index 6b4c2c989..cc49572b2 100644 --- a/LUFA/Drivers/USB/Class/CDC.h +++ b/LUFA/Drivers/USB/Class/CDC.h @@ -50,6 +50,10 @@ #ifndef _CDC_CLASS_H_
#define _CDC_CLASS_H_
+ /* Macros: */
+ #define __INCLUDE_FROM_CDC_DRIVER
+ #define __INCLUDE_FROM_USB_DRIVER
+
/* Includes: */
#include "../HighLevel/USBMode.h"
diff --git a/LUFA/Drivers/USB/Class/Common/Audio.h b/LUFA/Drivers/USB/Class/Common/Audio.h index 0e2c6928e..5d19b6f42 100644 --- a/LUFA/Drivers/USB/Class/Common/Audio.h +++ b/LUFA/Drivers/USB/Class/Common/Audio.h @@ -51,6 +51,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_AUDIO_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/Audio.h instead.
+ #endif
+
/* Macros: */
#if !defined(AUDIO_TOTAL_SAMPLE_RATES) || defined(__DOXYGEN__)
/** Total number of discrete audio sample rates supported by the device. This value can be overridden by defining this
diff --git a/LUFA/Drivers/USB/Class/Common/CDC.h b/LUFA/Drivers/USB/Class/Common/CDC.h index f6844979d..55f530ba9 100644 --- a/LUFA/Drivers/USB/Class/Common/CDC.h +++ b/LUFA/Drivers/USB/Class/Common/CDC.h @@ -51,6 +51,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_CDC_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/CDC.h instead.
+ #endif
+
/* Macros: */
/** CDC Class specific request to get the current virtual serial port configuration settings. */
#define REQ_GetLineEncoding 0x21
diff --git a/LUFA/Drivers/USB/Class/Common/HID.h b/LUFA/Drivers/USB/Class/Common/HID.h index 5afaf48c9..33a5af4ac 100644 --- a/LUFA/Drivers/USB/Class/Common/HID.h +++ b/LUFA/Drivers/USB/Class/Common/HID.h @@ -46,6 +46,11 @@ #include <string.h>
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_HID_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/HID.h instead.
+ #endif
+
/* Macros: */
/** HID Class Specific Request to get the current HID report from the device. */
#define REQ_GetReport 0x01
diff --git a/LUFA/Drivers/USB/Class/Common/MIDI.h b/LUFA/Drivers/USB/Class/Common/MIDI.h index d0813038e..8eed10198 100644 --- a/LUFA/Drivers/USB/Class/Common/MIDI.h +++ b/LUFA/Drivers/USB/Class/Common/MIDI.h @@ -41,6 +41,9 @@ #ifndef _MIDI_CLASS_COMMON_H_
#define _MIDI_CLASS_COMMON_H_
+ /* Macros: */
+ #define __INCLUDE_FROM_AUDIO_DRIVER
+
/* Includes: */
#include "../../USB.h"
#include "Audio.h"
@@ -52,6 +55,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_MIDI_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/MIDI.h instead.
+ #endif
+
/* Macros: */
/** Audio class descriptor subtype value for a Audio class specific MIDI input jack descriptor. */
#define DSUBTYPE_InputJack 0x02
diff --git a/LUFA/Drivers/USB/Class/Common/MassStorage.h b/LUFA/Drivers/USB/Class/Common/MassStorage.h index 942d06b74..8726148a2 100644 --- a/LUFA/Drivers/USB/Class/Common/MassStorage.h +++ b/LUFA/Drivers/USB/Class/Common/MassStorage.h @@ -51,6 +51,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_MS_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/MassStorage.h instead.
+ #endif
+
/* Macros: */
/** Mass Storage Class specific request to reset the Mass Storage interface, ready for the next command. */
#define REQ_MassStorageReset 0xFF
diff --git a/LUFA/Drivers/USB/Class/Common/Printer.h b/LUFA/Drivers/USB/Class/Common/Printer.h index ea6f1abb0..06ec0bb0b 100644 --- a/LUFA/Drivers/USB/Class/Common/Printer.h +++ b/LUFA/Drivers/USB/Class/Common/Printer.h @@ -49,8 +49,13 @@ /* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
- #endif
+ #endif + /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_PRINTER_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/Printer.h instead.
+ #endif
+
/* Macros: */
/** Port status mask for a printer device, indicating that an error has *not* occurred. */
#define PRNT_PORTSTATUS_NOTERROR (1 << 3)
diff --git a/LUFA/Drivers/USB/Class/Common/RNDIS.h b/LUFA/Drivers/USB/Class/Common/RNDIS.h index ef98ccd56..258604deb 100644 --- a/LUFA/Drivers/USB/Class/Common/RNDIS.h +++ b/LUFA/Drivers/USB/Class/Common/RNDIS.h @@ -41,10 +41,13 @@ #ifndef _RNDIS_CLASS_COMMON_H_
#define _RNDIS_CLASS_COMMON_H_
+ /* Macros: */
+ #define __INCLUDE_FROM_CDC_DRIVER
+
/* Includes: */
#include "../../USB.h"
- #include "CDC.h"
#include "RNDISConstants.h"
+ #include "CDC.h"
#include <string.h>
@@ -53,6 +56,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_RNDIS_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/RNDIS.h instead.
+ #endif
+
/* Macros: */
/** Implemented RNDIS Version Major */
#define REMOTE_NDIS_VERSION_MAJOR 0x01
diff --git a/LUFA/Drivers/USB/Class/Common/StillImage.h b/LUFA/Drivers/USB/Class/Common/StillImage.h index bbdc0d062..7b3df201a 100644 --- a/LUFA/Drivers/USB/Class/Common/StillImage.h +++ b/LUFA/Drivers/USB/Class/Common/StillImage.h @@ -51,6 +51,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_SI_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/StillImage.h instead.
+ #endif
+
/* Macros: */
/** Length in bytes of a given Unicode string's character length
*
diff --git a/LUFA/Drivers/USB/Class/Device/Audio.c b/LUFA/Drivers/USB/Class/Device/Audio.c index 89115f2db..d2572e9ab 100644 --- a/LUFA/Drivers/USB/Class/Device/Audio.c +++ b/LUFA/Drivers/USB/Class/Device/Audio.c @@ -28,9 +28,11 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
+#define __INCLUDE_FROM_AUDIO_DRIVER
#include "Audio.h"
void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
diff --git a/LUFA/Drivers/USB/Class/Device/Audio.h b/LUFA/Drivers/USB/Class/Device/Audio.h index c6b68b0cb..87fab9889 100644 --- a/LUFA/Drivers/USB/Class/Device/Audio.h +++ b/LUFA/Drivers/USB/Class/Device/Audio.h @@ -55,6 +55,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_AUDIO_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/Audio.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Type Defines: */
/** Class state structure. An instance of this structure should be made for each Audio interface
diff --git a/LUFA/Drivers/USB/Class/Device/CDC.c b/LUFA/Drivers/USB/Class/Device/CDC.c index b8a673f03..4cdea9485 100644 --- a/LUFA/Drivers/USB/Class/Device/CDC.c +++ b/LUFA/Drivers/USB/Class/Device/CDC.c @@ -28,10 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
-#define INCLUDE_FROM_CDC_CLASS_DEVICE_C
+#define __INCLUDE_FROM_CDC_CLASS_DEVICE_C
+#define __INCLUDE_FROM_CDC_DRIVER
#include "CDC.h"
void CDC_Device_Event_Stub(void)
diff --git a/LUFA/Drivers/USB/Class/Device/CDC.h b/LUFA/Drivers/USB/Class/Device/CDC.h index e6a2bfd5c..0c214441c 100644 --- a/LUFA/Drivers/USB/Class/Device/CDC.h +++ b/LUFA/Drivers/USB/Class/Device/CDC.h @@ -73,6 +73,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_CDC_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/CDC.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Type Defines: */
/** Class state structure. An instance of this structure should be made for each CDC interface
@@ -281,7 +286,7 @@ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_CDC_CLASS_DEVICE_C)
+ #if defined(__INCLUDE_FROM_CDC_CLASS_DEVICE_C)
static int CDC_Device_putchar(char c, FILE* Stream);
static int CDC_Device_getchar(FILE* Stream);
static int CDC_Device_getchar_Blocking(FILE* Stream);
diff --git a/LUFA/Drivers/USB/Class/Device/HID.c b/LUFA/Drivers/USB/Class/Device/HID.c index a5c03f726..cc1ad43b5 100644 --- a/LUFA/Drivers/USB/Class/Device/HID.c +++ b/LUFA/Drivers/USB/Class/Device/HID.c @@ -28,9 +28,11 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
+#define __INCLUDE_FROM_HID_DRIVER
#include "HID.h"
void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
diff --git a/LUFA/Drivers/USB/Class/Device/HID.h b/LUFA/Drivers/USB/Class/Device/HID.h index f62c08c39..15b428a7b 100644 --- a/LUFA/Drivers/USB/Class/Device/HID.h +++ b/LUFA/Drivers/USB/Class/Device/HID.h @@ -55,6 +55,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_HID_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/HID.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Type Defines: */
/** Class state structure. An instance of this structure should be made for each HID interface
diff --git a/LUFA/Drivers/USB/Class/Device/MIDI.c b/LUFA/Drivers/USB/Class/Device/MIDI.c index b72c2b027..d3f8f55b6 100644 --- a/LUFA/Drivers/USB/Class/Device/MIDI.c +++ b/LUFA/Drivers/USB/Class/Device/MIDI.c @@ -28,9 +28,11 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
+#define __INCLUDE_FROM_MIDI_DRIVER
#include "MIDI.h"
void MIDI_Device_ProcessControlRequest(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)
diff --git a/LUFA/Drivers/USB/Class/Device/MIDI.h b/LUFA/Drivers/USB/Class/Device/MIDI.h index 8517782e2..772456bc1 100644 --- a/LUFA/Drivers/USB/Class/Device/MIDI.h +++ b/LUFA/Drivers/USB/Class/Device/MIDI.h @@ -47,7 +47,6 @@ /* Includes: */
#include "../../USB.h"
#include "../Common/MIDI.h"
- #include "Audio.h"
#include <string.h>
@@ -56,6 +55,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_MIDI_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/MIDI.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Type Define: */
/** Class state structure. An instance of this structure should be made for each MIDI interface
diff --git a/LUFA/Drivers/USB/Class/Device/MassStorage.c b/LUFA/Drivers/USB/Class/Device/MassStorage.c index 941db6866..a5ebab029 100644 --- a/LUFA/Drivers/USB/Class/Device/MassStorage.c +++ b/LUFA/Drivers/USB/Class/Device/MassStorage.c @@ -28,10 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
-#define INCLUDE_FROM_MS_CLASS_DEVICE_C
+#define __INCLUDE_FROM_MS_CLASS_DEVICE_C
+#define __INCLUDE_FROM_MS_DRIVER
#include "MassStorage.h"
static volatile bool* CallbackIsResetSource;
diff --git a/LUFA/Drivers/USB/Class/Device/MassStorage.h b/LUFA/Drivers/USB/Class/Device/MassStorage.h index 7091dca74..87dcfb232 100644 --- a/LUFA/Drivers/USB/Class/Device/MassStorage.h +++ b/LUFA/Drivers/USB/Class/Device/MassStorage.h @@ -55,6 +55,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_MS_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/MassStorage.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Type Defines: */
/** Class state structure. An instance of this structure should be made for each Mass Storage interface
@@ -134,7 +139,7 @@ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_MS_CLASS_DEVICE_C)
+ #if defined(__INCLUDE_FROM_MS_CLASS_DEVICE_C)
static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t StreamCallback_MS_Device_AbortOnMassStoreReset(void);
diff --git a/LUFA/Drivers/USB/Class/Device/RNDIS.c b/LUFA/Drivers/USB/Class/Device/RNDIS.c index 0dc385942..1961e7e84 100644 --- a/LUFA/Drivers/USB/Class/Device/RNDIS.c +++ b/LUFA/Drivers/USB/Class/Device/RNDIS.c @@ -28,10 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
-#define INCLUDE_FROM_RNDIS_CLASS_DEVICE_C
+#define __INCLUDE_FROM_RNDIS_CLASS_DEVICE_C
+#define __INCLUDE_FROM_RNDIS_DRIVER
#include "RNDIS.h"
static const uint32_t PROGMEM AdapterSupportedOIDList[] =
diff --git a/LUFA/Drivers/USB/Class/Device/RNDIS.h b/LUFA/Drivers/USB/Class/Device/RNDIS.h index 91ec79868..7d6b3a882 100644 --- a/LUFA/Drivers/USB/Class/Device/RNDIS.h +++ b/LUFA/Drivers/USB/Class/Device/RNDIS.h @@ -55,6 +55,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_RNDIS_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/RNDIS.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Type Defines: */
/** Class state structure. An instance of this structure should be made for each RNDIS interface
@@ -131,7 +136,7 @@ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_RNDIS_CLASS_DEVICE_C)
+ #if defined(__INCLUDE_FROM_RNDIS_CLASS_DEVICE_C)
static void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)
ATTR_NON_NULL_PTR_ARG(1);
static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo,
diff --git a/LUFA/Drivers/USB/Class/HID.h b/LUFA/Drivers/USB/Class/HID.h index ebbfb4232..5eda33b2a 100644 --- a/LUFA/Drivers/USB/Class/HID.h +++ b/LUFA/Drivers/USB/Class/HID.h @@ -51,6 +51,10 @@ #ifndef _HID_CLASS_H_
#define _HID_CLASS_H_
+ /* Macros: */
+ #define __INCLUDE_FROM_HID_DRIVER
+ #define __INCLUDE_FROM_USB_DRIVER
+
/* Includes: */
#include "../HighLevel/USBMode.h"
diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c index 227ab94f8..cc1ff8a0b 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.c +++ b/LUFA/Drivers/USB/Class/Host/CDC.c @@ -28,10 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
-#define INCLUDE_FROM_CDC_CLASS_HOST_C
+#define __INCLUDE_FROM_CDC_CLASS_HOST_C
+#define __INCLUDE_FROM_CDC_DRIVER
#include "CDC.h"
uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, uint16_t ConfigDescriptorSize,
diff --git a/LUFA/Drivers/USB/Class/Host/CDC.h b/LUFA/Drivers/USB/Class/Host/CDC.h index 9433c59fa..feb6bf87a 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.h +++ b/LUFA/Drivers/USB/Class/Host/CDC.h @@ -56,6 +56,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_CDC_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/CDC.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Type Defines: */
/** Class state structure. An instance of this structure should be made within the user application,
@@ -286,7 +291,7 @@ #define CDC_FOUND_NOTIFICATION_IN (1 << 2)
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_CDC_CLASS_HOST_C)
+ #if defined(__INCLUDE_FROM_CDC_CLASS_HOST_C)
static int CDC_Host_putchar(char c, FILE* Stream);
static int CDC_Host_getchar(FILE* Stream);
static int CDC_Host_getchar_Blocking(FILE* Stream);
diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c index 3cd939411..1e1dbcff6 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.c +++ b/LUFA/Drivers/USB/Class/Host/HID.c @@ -28,10 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
-#define INCLUDE_FROM_HID_CLASS_HOST_C
+#define __INCLUDE_FROM_HID_CLASS_HOST_C
+#define __INCLUDE_FROM_HID_DRIVER
#include "HID.h"
uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, uint16_t ConfigDescriptorSize,
diff --git a/LUFA/Drivers/USB/Class/Host/HID.h b/LUFA/Drivers/USB/Class/Host/HID.h index 3aaf809fd..d4ea7ac63 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.h +++ b/LUFA/Drivers/USB/Class/Host/HID.h @@ -55,6 +55,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_HID_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/HID.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Error code for some HID Host functions, indicating a logical (and not hardware) error */
@@ -275,7 +280,7 @@ #define HID_FOUND_DATAPIPE_OUT (1 << 1)
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_HID_CLASS_HOST_C)
+ #if defined(__INCLUDE_FROM_HID_CLASS_HOST_C)
static uint8_t DComp_HID_Host_NextHIDInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DComp_NextHID(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.c b/LUFA/Drivers/USB/Class/Host/HIDParser.c index 6c81ae8e5..386c3b937 100644 --- a/LUFA/Drivers/USB/Class/Host/HIDParser.c +++ b/LUFA/Drivers/USB/Class/Host/HIDParser.c @@ -28,6 +28,7 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.h b/LUFA/Drivers/USB/Class/Host/HIDParser.h index b7225f332..b96989393 100644 --- a/LUFA/Drivers/USB/Class/Host/HIDParser.h +++ b/LUFA/Drivers/USB/Class/Host/HIDParser.h @@ -57,6 +57,10 @@ #ifndef __HIDPARSER_H__
#define __HIDPARSER_H__
+ /* Macros: */
+ #define __INCLUDE_FROM_USB_DRIVER
+ #define __INCLUDE_FROM_HID_DRIVER
+
/* Includes: */
#include <string.h>
#include <stdbool.h>
diff --git a/LUFA/Drivers/USB/Class/Host/MIDI.c b/LUFA/Drivers/USB/Class/Host/MIDI.c index a5ad4bf2b..c2e6257c4 100644 --- a/LUFA/Drivers/USB/Class/Host/MIDI.c +++ b/LUFA/Drivers/USB/Class/Host/MIDI.c @@ -28,10 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
-#define INCLUDE_FROM_MIDI_CLASS_HOST_C
+#define __INCLUDE_FROM_MIDI_CLASS_HOST_C
+#define __INCLUDE_FROM_MIDI_DRIVER
#include "MIDI.h"
uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo, uint16_t ConfigDescriptorSize,
diff --git a/LUFA/Drivers/USB/Class/Host/MIDI.h b/LUFA/Drivers/USB/Class/Host/MIDI.h index 7b1cba395..84779a0e8 100644 --- a/LUFA/Drivers/USB/Class/Host/MIDI.h +++ b/LUFA/Drivers/USB/Class/Host/MIDI.h @@ -53,6 +53,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_MIDI_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/MIDI.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Type Defines: */
/** Class state structure. An instance of this structure should be made within the user application,
@@ -172,7 +177,7 @@ #define MIDI_FOUND_DATAPIPE_OUT (1 << 1)
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_MIDI_CLASS_HOST_C)
+ #if defined(__INCLUDE_FROM_MIDI_CLASS_HOST_C)
static uint8_t DComp_MIDI_Host_NextMIDIStreamingInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DComp_MIDI_Host_NextMIDIStreamingDataEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
#endif
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.c b/LUFA/Drivers/USB/Class/Host/MassStorage.c index 7a302632b..1b67ba2c3 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.c +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.c @@ -28,10 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
-#define INCLUDE_FROM_MS_CLASS_HOST_C
+#define __INCLUDE_FROM_MS_CLASS_HOST_C
+#define __INCLUDE_FROM_MS_DRIVER
#include "MassStorage.h"
uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint16_t ConfigDescriptorSize,
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.h b/LUFA/Drivers/USB/Class/Host/MassStorage.h index 6dda5c0a9..502e9021d 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.h +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.h @@ -53,6 +53,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_MS_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/MassStorage.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Error code for some Mass Storage Host functions, indicating a logical (and not hardware) error */
@@ -296,7 +301,7 @@ #define MS_FOUND_DATAPIPE_OUT (1 << 1)
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_MS_CLASS_HOST_C)
+ #if defined(__INCLUDE_FROM_MS_CLASS_HOST_C)
static uint8_t DComp_NextMSInterface(void* const CurrentDescriptor);
static uint8_t DComp_NextMSInterfaceEndpoint(void* const CurrentDescriptor);
diff --git a/LUFA/Drivers/USB/Class/Host/Printer.c b/LUFA/Drivers/USB/Class/Host/Printer.c index d1fb7c91c..2d41a0c39 100644 --- a/LUFA/Drivers/USB/Class/Host/Printer.c +++ b/LUFA/Drivers/USB/Class/Host/Printer.c @@ -28,10 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
-#define INCLUDE_FROM_PRINTER_CLASS_HOST_C
+#define __INCLUDE_FROM_PRINTER_CLASS_HOST_C
+#define __INCLUDE_FROM_PRINTER_DRIVER
#include "Printer.h"
uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint16_t ConfigDescriptorSize,
diff --git a/LUFA/Drivers/USB/Class/Host/Printer.h b/LUFA/Drivers/USB/Class/Host/Printer.h index 06a1f8433..25b0beb7e 100644 --- a/LUFA/Drivers/USB/Class/Host/Printer.h +++ b/LUFA/Drivers/USB/Class/Host/Printer.h @@ -53,9 +53,12 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_PRINTER_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/Printer.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
- /* Macros: */
-
/* Type Defines: */
/** Class state structure. An instance of this structure should be made within the user application,
* and passed to each of the Printer class driver functions as the PRNTInterfaceInfo parameter. This
@@ -203,7 +206,7 @@ #define PRNT_FOUND_DATAPIPE_OUT (1 << 1)
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_PRINTER_CLASS_HOST_C)
+ #if defined(__INCLUDE_FROM_PRINTER_CLASS_HOST_C)
static uint8_t DComp_NextPRNTInterface(void* const CurrentDescriptor);
static uint8_t DComp_NextPRNTInterfaceEndpoint(void* const CurrentDescriptor);
#endif
diff --git a/LUFA/Drivers/USB/Class/Host/RNDIS.c b/LUFA/Drivers/USB/Class/Host/RNDIS.c index b06b89024..c7bf482c3 100644 --- a/LUFA/Drivers/USB/Class/Host/RNDIS.c +++ b/LUFA/Drivers/USB/Class/Host/RNDIS.c @@ -28,10 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
-#define INCLUDE_FROM_RNDIS_CLASS_HOST_C
+#define __INCLUDE_FROM_RNDIS_CLASS_HOST_C
+#define __INCLUDE_FROM_RNDIS_DRIVER
#include "RNDIS.h"
uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, uint16_t ConfigDescriptorSize,
diff --git a/LUFA/Drivers/USB/Class/Host/RNDIS.h b/LUFA/Drivers/USB/Class/Host/RNDIS.h index 0110b5a0d..f42ed439c 100644 --- a/LUFA/Drivers/USB/Class/Host/RNDIS.h +++ b/LUFA/Drivers/USB/Class/Host/RNDIS.h @@ -57,6 +57,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_RNDIS_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/RNDIS.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Type Defines: */
/** Class state structure. An instance of this structure should be made within the user application,
@@ -245,7 +250,7 @@ #define RNDIS_FOUND_NOTIFICATION_IN (1 << 2)
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_RNDIS_CLASS_HOST_C)
+ #if defined(__INCLUDE_FROM_RNDIS_CLASS_HOST_C)
static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t RNDIS_GetEncapsulatedResponse(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.c b/LUFA/Drivers/USB/Class/Host/StillImage.c index 2f5addaa1..577f619c8 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImage.c +++ b/LUFA/Drivers/USB/Class/Host/StillImage.c @@ -28,10 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
-#define INCLUDE_FROM_SI_CLASS_HOST_C
+#define __INCLUDE_FROM_SI_CLASS_HOST_C
+#define __INCLUDE_FROM_SI_DRIVER
#include "StillImage.h"
uint8_t SImage_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint16_t ConfigDescriptorSize,
diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.h b/LUFA/Drivers/USB/Class/Host/StillImage.h index b6a24757c..a2101262e 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImage.h +++ b/LUFA/Drivers/USB/Class/Host/StillImage.h @@ -53,6 +53,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_SI_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/Class/StillImage.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Error code for some Still Image Host functions, indicating a logical (and not hardware) error */
@@ -287,7 +292,7 @@ #define COMMAND_DATA_TIMEOUT_MS 10000
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_SI_CLASS_HOST_C)
+ #if defined(__INCLUDE_FROM_SI_CLASS_HOST_C)
static uint8_t DComp_SI_Host_NextSIInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DComp_SI_Host_NextSIInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
#endif
diff --git a/LUFA/Drivers/USB/Class/MIDI.h b/LUFA/Drivers/USB/Class/MIDI.h index 7fda7ae5e..41f2916d3 100644 --- a/LUFA/Drivers/USB/Class/MIDI.h +++ b/LUFA/Drivers/USB/Class/MIDI.h @@ -53,6 +53,10 @@ #ifndef _MIDI_CLASS_H_
#define _MIDI_CLASS_H_
+ /* Macros: */
+ #define __INCLUDE_FROM_MIDI_DRIVER
+ #define __INCLUDE_FROM_USB_DRIVER
+
/* Includes: */
#include "../HighLevel/USBMode.h"
diff --git a/LUFA/Drivers/USB/Class/MassStorage.h b/LUFA/Drivers/USB/Class/MassStorage.h index 9f123e213..ccc48f35b 100644 --- a/LUFA/Drivers/USB/Class/MassStorage.h +++ b/LUFA/Drivers/USB/Class/MassStorage.h @@ -50,6 +50,10 @@ #ifndef _MS_CLASS_H_
#define _MS_CLASS_H_
+ /* Macros: */
+ #define __INCLUDE_FROM_MS_DRIVER
+ #define __INCLUDE_FROM_USB_DRIVER
+
/* Includes: */
#include "../HighLevel/USBMode.h"
diff --git a/LUFA/Drivers/USB/Class/Printer.h b/LUFA/Drivers/USB/Class/Printer.h index 9f852e0c9..0de231d17 100644 --- a/LUFA/Drivers/USB/Class/Printer.h +++ b/LUFA/Drivers/USB/Class/Printer.h @@ -51,6 +51,10 @@ #ifndef _PRINTER_CLASS_H_
#define _PRINTER_CLASS_H_
+ /* Macros: */
+ #define __INCLUDE_FROM_PRINTER_DRIVER
+ #define __INCLUDE_FROM_USB_DRIVER
+
/* Includes: */
#include "../HighLevel/USBMode.h"
diff --git a/LUFA/Drivers/USB/Class/RNDIS.h b/LUFA/Drivers/USB/Class/RNDIS.h index 2dc3e7d27..8fd6d16c8 100644 --- a/LUFA/Drivers/USB/Class/RNDIS.h +++ b/LUFA/Drivers/USB/Class/RNDIS.h @@ -50,6 +50,10 @@ #ifndef _RNDIS_CLASS_H_
#define _RNDIS_CLASS_H_
+ /* Macros: */
+ #define __INCLUDE_FROM_RNDIS_DRIVER
+ #define __INCLUDE_FROM_USB_DRIVER
+
/* Includes: */
#include "../HighLevel/USBMode.h"
diff --git a/LUFA/Drivers/USB/Class/StillImage.h b/LUFA/Drivers/USB/Class/StillImage.h index 6e65d9e9f..1ba5ff77e 100644 --- a/LUFA/Drivers/USB/Class/StillImage.h +++ b/LUFA/Drivers/USB/Class/StillImage.h @@ -49,6 +49,10 @@ #ifndef _SI_CLASS_H_
#define _SI_CLASS_H_
+ /* Macros: */
+ #define __INCLUDE_FROM_SI_DRIVER
+ #define __INCLUDE_FROM_USB_DRIVER
+
/* Includes: */
#include "../HighLevel/USBMode.h"
diff --git a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c index 6dd36cd46..270a98aeb 100644 --- a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c +++ b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c @@ -28,6 +28,7 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "ConfigDescriptor.h"
#if defined(USB_CAN_BE_HOST)
diff --git a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h index df5109d20..454f0b61c 100644 --- a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h +++ b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h @@ -59,6 +59,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for determining the type of an endpoint from an endpoint descriptor. This should then be compared
diff --git a/LUFA/Drivers/USB/HighLevel/Events.c b/LUFA/Drivers/USB/HighLevel/Events.c index dcf9fcc21..4d9990788 100644 --- a/LUFA/Drivers/USB/HighLevel/Events.c +++ b/LUFA/Drivers/USB/HighLevel/Events.c @@ -28,9 +28,8 @@ this software.
*/
-#include "USBMode.h"
-
-#define INCLUDE_FROM_EVENTS_C
+#define __INCLUDE_FROM_EVENTS_C
+#define __INCLUDE_FROM_USB_DRIVER
#include "Events.h"
void USB_Event_Stub(void)
diff --git a/LUFA/Drivers/USB/HighLevel/Events.h b/LUFA/Drivers/USB/HighLevel/Events.h index 08727d749..12b30b250 100644 --- a/LUFA/Drivers/USB/HighLevel/Events.h +++ b/LUFA/Drivers/USB/HighLevel/Events.h @@ -60,9 +60,14 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Pseudo-Functions for Doxygen: */
- #if !defined(INCLUDE_FROM_EVENTS_C) || defined(__DOXYGEN__)
+ #if !defined(__INCLUDE_FROM_EVENTS_C) || defined(__DOXYGEN__)
/** Event for USB stack initialization failure. This event fires when the USB interface fails to
* initialize correctly due to a hardware or software fault.
*
@@ -287,7 +292,7 @@ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_EVENTS_C)
+ #if defined(__INCLUDE_FROM_EVENTS_C)
void USB_Event_Stub(void) ATTR_CONST;
#if defined(USB_CAN_BE_BOTH)
diff --git a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h index 404a44f2c..807eb78f8 100644 --- a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h +++ b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h @@ -58,6 +58,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Indicates that a given descriptor does not exist in the device. This can be used inside descriptors
diff --git a/LUFA/Drivers/USB/HighLevel/StdRequestType.h b/LUFA/Drivers/USB/HighLevel/StdRequestType.h index a887b5cdc..4fad0378b 100644 --- a/LUFA/Drivers/USB/HighLevel/StdRequestType.h +++ b/LUFA/Drivers/USB/HighLevel/StdRequestType.h @@ -40,6 +40,11 @@ #ifndef __STDREQTYPE_H__
#define __STDREQTYPE_H__
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for the request type parameter, to indicate the direction of the request data (Host to Device
diff --git a/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h b/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h index c502330d6..3d30655ec 100644 --- a/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h +++ b/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h @@ -41,6 +41,11 @@ #ifndef __STREAMCALLBACK_H__
#define __STREAMCALLBACK_H__
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Used with the Endpoint and Pipe stream functions as the callback function parameter, indicating that the stream
diff --git a/LUFA/Drivers/USB/HighLevel/USBInterrupt.c b/LUFA/Drivers/USB/HighLevel/USBInterrupt.c index ee6d16efc..f8da7e656 100644 --- a/LUFA/Drivers/USB/HighLevel/USBInterrupt.c +++ b/LUFA/Drivers/USB/HighLevel/USBInterrupt.c @@ -28,6 +28,7 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "USBInterrupt.h"
void USB_INT_DisableAllInterrupts(void)
diff --git a/LUFA/Drivers/USB/HighLevel/USBInterrupt.h b/LUFA/Drivers/USB/HighLevel/USBInterrupt.h index 5aa10db08..6ff7c70fa 100644 --- a/LUFA/Drivers/USB/HighLevel/USBInterrupt.h +++ b/LUFA/Drivers/USB/HighLevel/USBInterrupt.h @@ -45,6 +45,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */
diff --git a/LUFA/Drivers/USB/HighLevel/USBMode.h b/LUFA/Drivers/USB/HighLevel/USBMode.h index 0f2ecab88..ba2d45394 100644 --- a/LUFA/Drivers/USB/HighLevel/USBMode.h +++ b/LUFA/Drivers/USB/HighLevel/USBMode.h @@ -43,6 +43,11 @@ #ifndef __USBMODE_H__
#define __USBMODE_H__
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
#if defined(__DOXYGEN__)
/** Indicates that the target AVR microcontroller belongs to the Series 2 USB controller
diff --git a/LUFA/Drivers/USB/HighLevel/USBTask.c b/LUFA/Drivers/USB/HighLevel/USBTask.c index af3d7da90..afddcc1e5 100644 --- a/LUFA/Drivers/USB/HighLevel/USBTask.c +++ b/LUFA/Drivers/USB/HighLevel/USBTask.c @@ -28,9 +28,8 @@ this software.
*/
-#include "USBMode.h"
-
-#define INCLUDE_FROM_USBTASK_C
+#define __INCLUDE_FROM_USBTASK_C
+#define __INCLUDE_FROM_USB_DRIVER
#include "USBTask.h"
volatile bool USB_IsInitialized;
diff --git a/LUFA/Drivers/USB/HighLevel/USBTask.h b/LUFA/Drivers/USB/HighLevel/USBTask.h index 68d04af66..c01b84c37 100644 --- a/LUFA/Drivers/USB/HighLevel/USBTask.h +++ b/LUFA/Drivers/USB/HighLevel/USBTask.h @@ -54,6 +54,11 @@ #if defined(__cplusplus)
extern "C" {
#endif
+
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
/* Public Interface - May be used in end-application: */
/* Global Variables: */
@@ -164,7 +169,7 @@ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_USBTASK_C)
+ #if defined(__INCLUDE_FROM_USBTASK_C)
#if defined(USB_CAN_BE_HOST)
static void USB_HostTask(void);
#endif
diff --git a/LUFA/Drivers/USB/LowLevel/DevChapter9.c b/LUFA/Drivers/USB/LowLevel/DevChapter9.c index 3118302cf..7d9e81502 100644 --- a/LUFA/Drivers/USB/LowLevel/DevChapter9.c +++ b/LUFA/Drivers/USB/LowLevel/DevChapter9.c @@ -28,11 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
-#define INCLUDE_FROM_DEVCHAPTER9_C
+#define __INCLUDE_FROM_DEVCHAPTER9_C
#include "DevChapter9.h"
uint8_t USB_ConfigurationNumber;
diff --git a/LUFA/Drivers/USB/LowLevel/DevChapter9.h b/LUFA/Drivers/USB/LowLevel/DevChapter9.h index 3d49062ba..58a5dc80e 100644 --- a/LUFA/Drivers/USB/LowLevel/DevChapter9.h +++ b/LUFA/Drivers/USB/LowLevel/DevChapter9.h @@ -48,6 +48,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
#if defined(USE_SINGLE_DEVICE_CONFIGURATION)
@@ -124,7 +129,7 @@ /* Function Prototypes: */
void USB_Device_ProcessControlRequest(void);
- #if defined(INCLUDE_FROM_DEVCHAPTER9_C)
+ #if defined(__INCLUDE_FROM_DEVCHAPTER9_C)
static void USB_Device_SetAddress(void);
static void USB_Device_SetConfiguration(void);
static void USB_Device_GetConfiguration(void);
diff --git a/LUFA/Drivers/USB/LowLevel/Device.h b/LUFA/Drivers/USB/LowLevel/Device.h index 110adad12..1f929bff0 100644 --- a/LUFA/Drivers/USB/LowLevel/Device.h +++ b/LUFA/Drivers/USB/LowLevel/Device.h @@ -52,6 +52,10 @@ #if (defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS))
#error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
#endif
+
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
/* Public Interface - May be used in end-application: */
/* Macros: */
diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.c b/LUFA/Drivers/USB/LowLevel/Endpoint.c index 03be1185e..81fef1c2e 100644 --- a/LUFA/Drivers/USB/LowLevel/Endpoint.c +++ b/LUFA/Drivers/USB/LowLevel/Endpoint.c @@ -28,11 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
-#define INCLUDE_FROM_ENDPOINT_C
+#define __INCLUDE_FROM_ENDPOINT_C
#include "Endpoint.h"
#if !defined(FIXED_CONTROL_ENDPOINT_SIZE)
diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.h b/LUFA/Drivers/USB/LowLevel/Endpoint.h index b0934f586..6d98b78f0 100644 --- a/LUFA/Drivers/USB/LowLevel/Endpoint.h +++ b/LUFA/Drivers/USB/LowLevel/Endpoint.h @@ -83,6 +83,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Endpoint data direction mask for \ref Endpoint_ConfigureEndpoint(). This indicates that the endpoint
diff --git a/LUFA/Drivers/USB/LowLevel/Host.c b/LUFA/Drivers/USB/LowLevel/Host.c index a5452fdb6..e227fd194 100644 --- a/LUFA/Drivers/USB/LowLevel/Host.c +++ b/LUFA/Drivers/USB/LowLevel/Host.c @@ -28,11 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
-#define INCLUDE_FROM_HOST_C
+#define __INCLUDE_FROM_HOST_C
#include "Host.h"
void USB_Host_ProcessNextHostState(void)
diff --git a/LUFA/Drivers/USB/LowLevel/Host.h b/LUFA/Drivers/USB/LowLevel/Host.h index 07ff0fce7..5672dd531 100644 --- a/LUFA/Drivers/USB/LowLevel/Host.h +++ b/LUFA/Drivers/USB/LowLevel/Host.h @@ -55,6 +55,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Indicates the fixed USB device address which any attached device is enumerated to when in
@@ -397,7 +402,7 @@ void USB_Host_ProcessNextHostState(void);
uint8_t USB_Host_WaitMS(uint8_t MS);
- #if defined(INCLUDE_FROM_HOST_C)
+ #if defined(__INCLUDE_FROM_HOST_C)
static void USB_Host_ResetDevice(void);
#endif
#endif
diff --git a/LUFA/Drivers/USB/LowLevel/HostChapter9.c b/LUFA/Drivers/USB/LowLevel/HostChapter9.c index ff7ed86c0..e5072c8a8 100644 --- a/LUFA/Drivers/USB/LowLevel/HostChapter9.c +++ b/LUFA/Drivers/USB/LowLevel/HostChapter9.c @@ -28,11 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
-#define INCLUDE_FROM_HOSTCHAPTER9_C
+#define __INCLUDE_FROM_HOSTCHAPTER9_C
#include "HostChapter9.h"
uint8_t USB_Host_SendControlRequest(void* BufferPtr)
diff --git a/LUFA/Drivers/USB/LowLevel/HostChapter9.h b/LUFA/Drivers/USB/LowLevel/HostChapter9.h index fc8dfe2a5..1a85cf6d6 100644 --- a/LUFA/Drivers/USB/LowLevel/HostChapter9.h +++ b/LUFA/Drivers/USB/LowLevel/HostChapter9.h @@ -44,6 +44,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Enums: */
/** Enum for the \ref USB_Host_SendControlRequest() return code, indicating the reason for the error
@@ -89,7 +94,7 @@ };
/* Function Prototypes: */
- #if defined(INCLUDE_FROM_HOSTCHAPTER9_C)
+ #if defined(__INCLUDE_FROM_HOSTCHAPTER9_C)
static uint8_t USB_Host_WaitForIOS(const uint8_t WaitType);
#endif
#endif
diff --git a/LUFA/Drivers/USB/LowLevel/LowLevel.c b/LUFA/Drivers/USB/LowLevel/LowLevel.c index b49c5b8ce..f4f277ccb 100644 --- a/LUFA/Drivers/USB/LowLevel/LowLevel.c +++ b/LUFA/Drivers/USB/LowLevel/LowLevel.c @@ -28,6 +28,7 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "LowLevel.h"
#if (!defined(USB_HOST_ONLY) && !defined(USB_DEVICE_ONLY))
diff --git a/LUFA/Drivers/USB/LowLevel/LowLevel.h b/LUFA/Drivers/USB/LowLevel/LowLevel.h index dc01d24e5..1a92d470b 100644 --- a/LUFA/Drivers/USB/LowLevel/LowLevel.h +++ b/LUFA/Drivers/USB/LowLevel/LowLevel.h @@ -70,6 +70,10 @@ #endif
/* Preprocessor Checks and Defines: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
#if !defined(F_CLOCK)
#error F_CLOCK is not defined. You must define F_CLOCK to the frequency of the unprescaled input clock in your project makefile.
#endif
diff --git a/LUFA/Drivers/USB/LowLevel/OTG.h b/LUFA/Drivers/USB/LowLevel/OTG.h index 9cce2e690..25cb180a1 100644 --- a/LUFA/Drivers/USB/LowLevel/OTG.h +++ b/LUFA/Drivers/USB/LowLevel/OTG.h @@ -47,6 +47,11 @@ #include "../../../Common/Common.h"
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for the VBUS pulsing method of SRP, supported by some OTG devices.
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c index 2b956a8da..78c82e8c4 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.c +++ b/LUFA/Drivers/USB/LowLevel/Pipe.c @@ -28,11 +28,12 @@ this software.
*/
+#define __INCLUDE_FROM_USB_DRIVER
#include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
-#define INCLUDE_FROM_PIPE_C
+#define __INCLUDE_FROM_PIPE_C
#include "Pipe.h"
uint8_t USB_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.h b/LUFA/Drivers/USB/LowLevel/Pipe.h index 16b5ea670..3e25d4976 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.h +++ b/LUFA/Drivers/USB/LowLevel/Pipe.h @@ -91,6 +91,11 @@ extern "C" {
#endif
+ /* Preprocessor Checks: */
+ #if !defined(__INCLUDE_FROM_USB_DRIVER)
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Mask for \ref Pipe_GetErrorFlags(), indicating that an overflow error occurred in the pipe on the received data. */
diff --git a/LUFA/Drivers/USB/USB.h b/LUFA/Drivers/USB/USB.h index a632f52e2..3bc356d8e 100644 --- a/LUFA/Drivers/USB/USB.h +++ b/LUFA/Drivers/USB/USB.h @@ -350,6 +350,11 @@ #ifndef __USB_H__
#define __USB_H__
+ /* Macros: */
+ #if !defined(__DOXYGEN__)
+ #define __INCLUDE_FROM_USB_DRIVER
+ #endif
+
/* Includes: */
#include "HighLevel/USBMode.h"
|