diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-02-11 04:05:02 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-02-11 04:05:02 +0000 |
commit | d49cc0f7830319e701294e19937fae4de26ae8e2 (patch) | |
tree | a6353899c8cc6940a6540832b36891345483c474 /LUFA/Drivers/USB/Class | |
parent | 3a2c1db6751979ae3e5d7a6fa51026f9c44c71c0 (diff) | |
download | lufa-d49cc0f7830319e701294e19937fae4de26ae8e2.tar.gz lufa-d49cc0f7830319e701294e19937fae4de26ae8e2.tar.bz2 lufa-d49cc0f7830319e701294e19937fae4de26ae8e2.zip |
Add more include protection macros to give the user warnings when they try to manually include private driver header files, instead of the public driver headers.
Diffstat (limited to 'LUFA/Drivers/USB/Class')
44 files changed, 196 insertions, 25 deletions
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"
|