diff --git a/Usb.cpp b/Usb.cpp index ec273f43..c73760e2 100644 --- a/Usb.cpp +++ b/Usb.cpp @@ -16,17 +16,17 @@ e-mail : support@circuitsathome.com */ /* USB functions */ -#include "avrpins.h" -#include "max3421e.h" -#include "usbhost.h" -#include "Usb.h" - #if defined(ARDUINO) && ARDUINO >=100 #include "Arduino.h" #else #include #endif +#include "avrpins.h" +#include "max3421e.h" +#include "usbhost.h" +#include "Usb.h" + static uint8_t usb_error = 0; static uint8_t usb_task_state; diff --git a/Usb.h b/Usb.h index 9992aa31..152543fd 100644 --- a/Usb.h +++ b/Usb.h @@ -18,6 +18,12 @@ e-mail : support@circuitsathome.com #ifndef _usb_h_ #define _usb_h_ +#if defined(ARDUINO) && ARDUINO >=100 +#include "Arduino.h" +#else +#include +#endif + //#define BOARD_BLACK_WIDDOW #define USB_METHODS_INLINE @@ -31,12 +37,6 @@ e-mail : support@circuitsathome.com #include "usbhost.h" #include "usb_ch9.h" #include "address.h" - -#if defined(ARDUINO) && ARDUINO >=100 -#include "Arduino.h" -#else -#include -#endif #include "message.h" /* shield pins. First parameter - SS pin, second parameter - INT pin */ diff --git a/adk.h b/adk.h index 4ea0ed63..8ad4543a 100644 --- a/adk.h +++ b/adk.h @@ -20,6 +20,12 @@ e-mail : support@circuitsathome.com #if !defined(_ADK_H_) #define _ADK_H_ +#if defined(ARDUINO) && ARDUINO >=100 +#include "Arduino.h" +#else +#include +#endif + #include #include #include "avrpins.h" @@ -28,12 +34,6 @@ e-mail : support@circuitsathome.com #include "usb_ch9.h" #include "Usb.h" -#if defined(ARDUINO) && ARDUINO >=100 -#include "Arduino.h" -#else -#include -#endif - #include "printhex.h" #include "hexdump.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)); } -#endif // _ADK_H_ \ No newline at end of file +#endif // _ADK_H_ diff --git a/cdcacm.h b/cdcacm.h index 469d9383..41b9b23f 100644 --- a/cdcacm.h +++ b/cdcacm.h @@ -17,6 +17,12 @@ e-mail : support@circuitsathome.com #if !defined(__CDCACM_H__) #define __CDCACM_H__ +#if defined(ARDUINO) && ARDUINO >=100 +#include "Arduino.h" +#else +#include +#endif + #include #include #include "avrpins.h" @@ -25,12 +31,6 @@ e-mail : support@circuitsathome.com #include "usb_ch9.h" #include "Usb.h" -#if defined(ARDUINO) && ARDUINO >=100 -#include "Arduino.h" -#else -#include -#endif - #include "printhex.h" #include "hexdump.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); }; -#endif // __CDCACM_H__ \ No newline at end of file +#endif // __CDCACM_H__ diff --git a/cdcprolific.h b/cdcprolific.h index 9d7a31ce..cc1304f0 100644 --- a/cdcprolific.h +++ b/cdcprolific.h @@ -17,6 +17,12 @@ e-mail : support@circuitsathome.com #if !defined(__CDCPROLIFIC_H__) #define __CDCPROLIFIC_H__ +#if defined(ARDUINO) && ARDUINO >=100 +#include "Arduino.h" +#else +#include +#endif + #include #include #include "avrpins.h" @@ -25,12 +31,6 @@ e-mail : support@circuitsathome.com #include "usb_ch9.h" #include "Usb.h" -#if defined(ARDUINO) && ARDUINO >=100 -#include "Arduino.h" -#else -#include -#endif - #include "printhex.h" #include "hexdump.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); }; -#endif // __CDCPROLIFIC_H__ \ No newline at end of file +#endif // __CDCPROLIFIC_H__ diff --git a/hid.h b/hid.h index f894a64d..307a6ad5 100644 --- a/hid.h +++ b/hid.h @@ -17,6 +17,12 @@ e-mail : support@circuitsathome.com #if !defined(__HID_H__) #define __HID_H__ +#if defined(ARDUINO) && ARDUINO >=100 +#include "Arduino.h" +#else +#include +#endif + #include #include #include "avrpins.h" @@ -25,12 +31,6 @@ e-mail : support@circuitsathome.com #include "usb_ch9.h" #include "Usb.h" -#if defined(ARDUINO) && ARDUINO >=100 -#include "Arduino.h" -#else -#include -#endif - #include "printhex.h" #include "hexdump.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); }; -#endif // __HID_H__ \ No newline at end of file +#endif // __HID_H__ diff --git a/hidboot.h b/hidboot.h index bfcdebdb..ca1fb534 100644 --- a/hidboot.h +++ b/hidboot.h @@ -17,6 +17,12 @@ e-mail : support@circuitsathome.com #if !defined(__HIDBOOT_H__) #define __HIDBOOT_H__ +#if defined(ARDUINO) && ARDUINO >=100 +#include "Arduino.h" +#else +#include +#endif + #include #include #include "avrpins.h" @@ -26,12 +32,6 @@ e-mail : support@circuitsathome.com #include "Usb.h" #include "hid.h" -#if defined(ARDUINO) && ARDUINO >=100 -#include "Arduino.h" -#else -#include -#endif - #include "printhex.h" #include "hexdump.h" #include "message.h" @@ -494,4 +494,4 @@ uint8_t HIDBoot::Poll() { } -#endif // __HIDBOOTMOUSE_H__ \ No newline at end of file +#endif // __HIDBOOTMOUSE_H__ diff --git a/hidescriptorparser.h b/hidescriptorparser.h index 1c4a1900..e491d0cc 100644 --- a/hidescriptorparser.h +++ b/hidescriptorparser.h @@ -17,6 +17,12 @@ e-mail : support@circuitsathome.com #if !defined(__HIDDESCRIPTORPARSER_H__) #define __HIDDESCRIPTORPARSER_H__ +#if defined(ARDUINO) && ARDUINO >=100 +#include "Arduino.h" +#else +#include +#endif + #include #include #include "avrpins.h" @@ -25,12 +31,6 @@ e-mail : support@circuitsathome.com #include "usb_ch9.h" #include "Usb.h" -#if defined(ARDUINO) && ARDUINO >=100 -#include "Arduino.h" -#else -#include -#endif - #include "printhex.h" #include "hexdump.h" #include "message.h" @@ -188,4 +188,4 @@ public: virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf); }; -#endif // __HIDDESCRIPTORPARSER_H__ \ No newline at end of file +#endif // __HIDDESCRIPTORPARSER_H__ diff --git a/masstorage.h b/masstorage.h index 82a8abf0..81855faf 100644 --- a/masstorage.h +++ b/masstorage.h @@ -1,6 +1,12 @@ #if !defined(__MASSTORAGE_H__) #define __MASSTORAGE_H__ +#if defined(ARDUINO) && ARDUINO >=100 +#include "Arduino.h" +#else +#include +#endif + #define DEBUG #include @@ -11,12 +17,6 @@ #include "usb_ch9.h" #include "Usb.h" -#if defined(ARDUINO) && ARDUINO >=100 -#include "Arduino.h" -#else -#include -#endif - #include #define SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) diff --git a/message.cpp b/message.cpp index ecbc0d40..7aab07e8 100644 --- a/message.cpp +++ b/message.cpp @@ -15,6 +15,12 @@ Web : http://www.circuitsathome.com e-mail : support@circuitsathome.com */ +#if defined(ARDUINO) && ARDUINO >=100 +#include "Arduino.h" +#else +#include +#endif + #define DEBUG #include "message.h" // 0x80 is the default (i.e. trace) to turn off set this global to something lower. diff --git a/parsetools.h b/parsetools.h index 59402df2..c51b9862 100644 --- a/parsetools.h +++ b/parsetools.h @@ -17,18 +17,18 @@ e-mail : support@circuitsathome.com #if !defined(__PARSETOOLS_H__) #define __PARSETOOLS_H__ -#include -#include -#include "printhex.h" -#include "hexdump.h" -#include "message.h" - #if defined(ARDUINO) && ARDUINO >=100 #include "Arduino.h" #else #include #endif +#include +#include +#include "printhex.h" +#include "hexdump.h" +#include "message.h" + struct MultiValueBuffer { uint8_t valueSize; void *pValue; diff --git a/usbhub.h b/usbhub.h index 0150c4b3..b2426693 100644 --- a/usbhub.h +++ b/usbhub.h @@ -17,6 +17,12 @@ e-mail : support@circuitsathome.com #if !defined(__USBHUB_H__) #define __USBHUB_H__ +#if defined(ARDUINO) && ARDUINO >=100 +#include "Arduino.h" +#else +#include +#endif + #include #include #include "avrpins.h" @@ -26,12 +32,6 @@ e-mail : support@circuitsathome.com #include "Usb.h" -#if defined(ARDUINO) && ARDUINO >=100 -#include "Arduino.h" -#else -#include -#endif - #define USB_DESCRIPTOR_HUB 0x09 // Hub descriptor type // Hub Requests