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,6 +28,7 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "ConfigDescriptor.h"
#if defined(USB_CAN_BE_HOST)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -28,6 +28,7 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "USBInterrupt.h"
void USB_INT_DisableAllInterrupts(void)

View file

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

View file

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

View file

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

View file

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