Include system headers before library headers (fix DEBUG issue with newlib)

This commit is contained in:
PaulStoffregen 2013-05-29 10:40:45 -07:00
parent fca5a4125f
commit c9815144af
12 changed files with 77 additions and 71 deletions

10
Usb.cpp
View file

@ -16,17 +16,17 @@ e-mail : support@circuitsathome.com
*/ */
/* USB functions */ /* USB functions */
#include "avrpins.h"
#include "max3421e.h"
#include "usbhost.h"
#include "Usb.h"
#if defined(ARDUINO) && ARDUINO >=100 #if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h" #include "Arduino.h"
#else #else
#include <WProgram.h> #include <WProgram.h>
#endif #endif
#include "avrpins.h"
#include "max3421e.h"
#include "usbhost.h"
#include "Usb.h"
static uint8_t usb_error = 0; static uint8_t usb_error = 0;
static uint8_t usb_task_state; static uint8_t usb_task_state;

12
Usb.h
View file

@ -18,6 +18,12 @@ e-mail : support@circuitsathome.com
#ifndef _usb_h_ #ifndef _usb_h_
#define _usb_h_ #define _usb_h_
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
//#define BOARD_BLACK_WIDDOW //#define BOARD_BLACK_WIDDOW
#define USB_METHODS_INLINE #define USB_METHODS_INLINE
@ -31,12 +37,6 @@ e-mail : support@circuitsathome.com
#include "usbhost.h" #include "usbhost.h"
#include "usb_ch9.h" #include "usb_ch9.h"
#include "address.h" #include "address.h"
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include "message.h" #include "message.h"
/* shield pins. First parameter - SS pin, second parameter - INT pin */ /* shield pins. First parameter - SS pin, second parameter - INT pin */

14
adk.h
View file

@ -20,6 +20,12 @@ e-mail : support@circuitsathome.com
#if !defined(_ADK_H_) #if !defined(_ADK_H_)
#define _ADK_H_ #define _ADK_H_
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include <inttypes.h> #include <inttypes.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include "avrpins.h" #include "avrpins.h"
@ -28,12 +34,6 @@ e-mail : support@circuitsathome.com
#include "usb_ch9.h" #include "usb_ch9.h"
#include "Usb.h" #include "Usb.h"
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include "printhex.h" #include "printhex.h"
#include "hexdump.h" #include "hexdump.h"
#include "message.h" #include "message.h"
@ -146,4 +146,4 @@ inline uint8_t ADK::switchAcc(void) {
return( pUsb->ctrlReq(bAddress, 0, bmREQ_ADK_SEND, ADK_ACCSTART, 0, 0, 0, 0, 0, NULL, NULL)); return( pUsb->ctrlReq(bAddress, 0, bmREQ_ADK_SEND, ADK_ACCSTART, 0, 0, 0, 0, 0, NULL, NULL));
} }
#endif // _ADK_H_ #endif // _ADK_H_

View file

@ -17,6 +17,12 @@ e-mail : support@circuitsathome.com
#if !defined(__CDCACM_H__) #if !defined(__CDCACM_H__)
#define __CDCACM_H__ #define __CDCACM_H__
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include <inttypes.h> #include <inttypes.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include "avrpins.h" #include "avrpins.h"
@ -25,12 +31,6 @@ e-mail : support@circuitsathome.com
#include "usb_ch9.h" #include "usb_ch9.h"
#include "Usb.h" #include "Usb.h"
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include "printhex.h" #include "printhex.h"
#include "hexdump.h" #include "hexdump.h"
#include "message.h" #include "message.h"
@ -208,4 +208,4 @@ public:
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep); virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
}; };
#endif // __CDCACM_H__ #endif // __CDCACM_H__

View file

@ -17,6 +17,12 @@ e-mail : support@circuitsathome.com
#if !defined(__CDCPROLIFIC_H__) #if !defined(__CDCPROLIFIC_H__)
#define __CDCPROLIFIC_H__ #define __CDCPROLIFIC_H__
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include <inttypes.h> #include <inttypes.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include "avrpins.h" #include "avrpins.h"
@ -25,12 +31,6 @@ e-mail : support@circuitsathome.com
#include "usb_ch9.h" #include "usb_ch9.h"
#include "Usb.h" #include "Usb.h"
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include "printhex.h" #include "printhex.h"
#include "hexdump.h" #include "hexdump.h"
#include "message.h" #include "message.h"
@ -150,4 +150,4 @@ public:
//virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep); //virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
}; };
#endif // __CDCPROLIFIC_H__ #endif // __CDCPROLIFIC_H__

14
hid.h
View file

@ -17,6 +17,12 @@ e-mail : support@circuitsathome.com
#if !defined(__HID_H__) #if !defined(__HID_H__)
#define __HID_H__ #define __HID_H__
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include <inttypes.h> #include <inttypes.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include "avrpins.h" #include "avrpins.h"
@ -25,12 +31,6 @@ e-mail : support@circuitsathome.com
#include "usb_ch9.h" #include "usb_ch9.h"
#include "Usb.h" #include "Usb.h"
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include "printhex.h" #include "printhex.h"
#include "hexdump.h" #include "hexdump.h"
#include "message.h" #include "message.h"
@ -198,4 +198,4 @@ public:
uint8_t SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t* dataptr); uint8_t SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t* dataptr);
}; };
#endif // __HID_H__ #endif // __HID_H__

View file

@ -17,6 +17,12 @@ e-mail : support@circuitsathome.com
#if !defined(__HIDBOOT_H__) #if !defined(__HIDBOOT_H__)
#define __HIDBOOT_H__ #define __HIDBOOT_H__
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include <inttypes.h> #include <inttypes.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include "avrpins.h" #include "avrpins.h"
@ -26,12 +32,6 @@ e-mail : support@circuitsathome.com
#include "Usb.h" #include "Usb.h"
#include "hid.h" #include "hid.h"
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include "printhex.h" #include "printhex.h"
#include "hexdump.h" #include "hexdump.h"
#include "message.h" #include "message.h"
@ -494,4 +494,4 @@ uint8_t HIDBoot<BOOT_PROTOCOL>::Poll() {
} }
#endif // __HIDBOOTMOUSE_H__ #endif // __HIDBOOTMOUSE_H__

View file

@ -17,6 +17,12 @@ e-mail : support@circuitsathome.com
#if !defined(__HIDDESCRIPTORPARSER_H__) #if !defined(__HIDDESCRIPTORPARSER_H__)
#define __HIDDESCRIPTORPARSER_H__ #define __HIDDESCRIPTORPARSER_H__
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include <inttypes.h> #include <inttypes.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include "avrpins.h" #include "avrpins.h"
@ -25,12 +31,6 @@ e-mail : support@circuitsathome.com
#include "usb_ch9.h" #include "usb_ch9.h"
#include "Usb.h" #include "Usb.h"
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include "printhex.h" #include "printhex.h"
#include "hexdump.h" #include "hexdump.h"
#include "message.h" #include "message.h"
@ -188,4 +188,4 @@ public:
virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf); virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf);
}; };
#endif // __HIDDESCRIPTORPARSER_H__ #endif // __HIDDESCRIPTORPARSER_H__

View file

@ -1,6 +1,12 @@
#if !defined(__MASSTORAGE_H__) #if !defined(__MASSTORAGE_H__)
#define __MASSTORAGE_H__ #define __MASSTORAGE_H__
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#define DEBUG #define DEBUG
#include <inttypes.h> #include <inttypes.h>
@ -11,12 +17,6 @@
#include "usb_ch9.h" #include "usb_ch9.h"
#include "Usb.h" #include "Usb.h"
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include <confdescparser.h> #include <confdescparser.h>
#define SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) #define SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b)))

View file

@ -15,6 +15,12 @@ Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com e-mail : support@circuitsathome.com
*/ */
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#define DEBUG #define DEBUG
#include "message.h" #include "message.h"
// 0x80 is the default (i.e. trace) to turn off set this global to something lower. // 0x80 is the default (i.e. trace) to turn off set this global to something lower.

View file

@ -17,18 +17,18 @@ e-mail : support@circuitsathome.com
#if !defined(__PARSETOOLS_H__) #if !defined(__PARSETOOLS_H__)
#define __PARSETOOLS_H__ #define __PARSETOOLS_H__
#include <inttypes.h>
#include <avr/pgmspace.h>
#include "printhex.h"
#include "hexdump.h"
#include "message.h"
#if defined(ARDUINO) && ARDUINO >=100 #if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h" #include "Arduino.h"
#else #else
#include <WProgram.h> #include <WProgram.h>
#endif #endif
#include <inttypes.h>
#include <avr/pgmspace.h>
#include "printhex.h"
#include "hexdump.h"
#include "message.h"
struct MultiValueBuffer { struct MultiValueBuffer {
uint8_t valueSize; uint8_t valueSize;
void *pValue; void *pValue;

View file

@ -17,6 +17,12 @@ e-mail : support@circuitsathome.com
#if !defined(__USBHUB_H__) #if !defined(__USBHUB_H__)
#define __USBHUB_H__ #define __USBHUB_H__
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#include <inttypes.h> #include <inttypes.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include "avrpins.h" #include "avrpins.h"
@ -26,12 +32,6 @@ e-mail : support@circuitsathome.com
#include "Usb.h" #include "Usb.h"
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#define USB_DESCRIPTOR_HUB 0x09 // Hub descriptor type #define USB_DESCRIPTOR_HUB 0x09 // Hub descriptor type
// Hub Requests // Hub Requests