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.

This commit is contained in:
Dean Camera 2010-02-11 04:05:02 +00:00
parent 3a2c1db675
commit d49cc0f783
111 changed files with 341 additions and 85 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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: */

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -28,6 +28,7 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "LowLevel.h"
#if (!defined(USB_HOST_ONLY) && !defined(USB_DEVICE_ONLY))

View file

@ -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

View file

@ -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.

View file

@ -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;

View file

@ -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. */