compile faster

This commit is contained in:
Andrew J. Kroll 2013-09-23 18:40:10 -04:00
parent 114c8f079b
commit 1a0d0690d3
26 changed files with 57 additions and 129 deletions

1
BTD.h
View file

@ -19,7 +19,6 @@
#define _btd_h_ #define _btd_h_
#include "Usb.h" #include "Usb.h"
#include "confdescparser.h"
//PID and VID of the Sony PS3 devices //PID and VID of the Sony PS3 devices
#define PS3_VID 0x054C // Sony Corporation #define PS3_VID 0x054C // Sony Corporation

View file

@ -18,12 +18,6 @@
#ifndef _ps3usb_h_ #ifndef _ps3usb_h_
#define _ps3usb_h_ #define _ps3usb_h_
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "Usb.h" #include "Usb.h"
#include "PS3Enums.h" #include "PS3Enums.h"

16
Usb.h
View file

@ -22,11 +22,19 @@ e-mail : support@circuitsathome.com
// Not used anymore? // Not used anymore?
//#define USB_METHODS_INLINE //#define USB_METHODS_INLINE
//#include <assert.h> //#include <assert.h>
#include <inttypes.h>
#include <stddef.h>
#include <stdio.h>
#include "settings.h" #include "settings.h"
#include "address.h" #include "printhex.h"
#include "usbhost.h"
#include "message.h" #include "message.h"
#include "hexdump.h"
#include "max3421e.h"
#include "address.h"
#include "avrpins.h"
#include "usb_ch9.h"
#include "usbhost.h"
/* shield pins. First parameter - SS pin, second parameter - INT pin */ /* shield pins. First parameter - SS pin, second parameter - INT pin */
#ifdef BOARD_BLACK_WIDDOW #ifdef BOARD_BLACK_WIDDOW
@ -268,4 +276,8 @@ inline uint8_t USB::setConf(uint8_t addr, uint8_t ep, uint8_t conf_value) {
#endif // defined(USB_METHODS_INLINE) #endif // defined(USB_METHODS_INLINE)
#include "parsetools.h"
#include "confdescparser.h"
#endif //_usb_h_ #endif //_usb_h_

View file

@ -18,14 +18,8 @@
#ifndef _xboxold_h_ #ifndef _xboxold_h_
#define _xboxold_h_ #define _xboxold_h_
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "Usb.h" #include "Usb.h"
#include "controllerEnums.h" #include "controllerEnums.h"
/* Data Xbox taken from descriptors */ /* Data Xbox taken from descriptors */
#define EP_MAXPKTSIZE 32 // Max size for data via USB #define EP_MAXPKTSIZE 32 // Max size for data via USB

View file

@ -20,12 +20,6 @@
#ifndef _xboxrecv_h_ #ifndef _xboxrecv_h_
#define _xboxrecv_h_ #define _xboxrecv_h_
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "Usb.h" #include "Usb.h"
#include "xboxEnums.h" #include "xboxEnums.h"

View file

@ -18,12 +18,6 @@
#ifndef _xboxusb_h_ #ifndef _xboxusb_h_
#define _xboxusb_h_ #define _xboxusb_h_
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "Usb.h" #include "Usb.h"
#include "xboxEnums.h" #include "xboxEnums.h"

View file

@ -14,12 +14,12 @@ Circuits At Home, LTD
Web : http://www.circuitsathome.com Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com e-mail : support@circuitsathome.com
*/ */
#if !defined(__ADDRESS_H__)
#if !defined(_usb_h_) || defined(__ADDRESS_H__)
#error "Never include address.h directly; include Usb.h instead"
#else
#define __ADDRESS_H__ #define __ADDRESS_H__
#include <inttypes.h>
#include <stddef.h>
#include "max3421e.h"
/* NAK powers. To save space in endpoint data structure, amount of retries before giving up and returning 0x4 is stored in */ /* NAK powers. To save space in endpoint data structure, amount of retries before giving up and returning 0x4 is stored in */

6
adk.h
View file

@ -21,12 +21,6 @@ e-mail : support@circuitsathome.com
#define _ADK_H_ #define _ADK_H_
#include "Usb.h" #include "Usb.h"
#include <avr/pgmspace.h>
#include "printhex.h"
#include "hexdump.h"
#include "confdescparser.h"
#define ADK_VID 0x18D1 #define ADK_VID 0x18D1
#define ADK_PID 0x2D00 #define ADK_PID 0x2D00

View file

@ -18,12 +18,6 @@ e-mail : support@circuitsathome.com
#define __CDCACM_H__ #define __CDCACM_H__
#include "Usb.h" #include "Usb.h"
#include <avr/pgmspace.h>
#include "printhex.h"
#include "hexdump.h"
#include "confdescparser.h"
#define bmREQ_CDCOUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE #define bmREQ_CDCOUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
#define bmREQ_CDCIN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE #define bmREQ_CDCIN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE

View file

@ -18,13 +18,6 @@ e-mail : support@circuitsathome.com
#define __CDCFTDI_H__ #define __CDCFTDI_H__
#include "Usb.h" #include "Usb.h"
#include <avr/pgmspace.h>
#include "usbhost.h"
#include "printhex.h"
#include "hexdump.h"
#include "confdescparser.h"
#define bmREQ_FTDI_OUT 0x40 #define bmREQ_FTDI_OUT 0x40
#define bmREQ_FTDI_IN 0xc0 #define bmREQ_FTDI_IN 0xc0

View file

@ -14,16 +14,12 @@ Circuits At Home, LTD
Web : http://www.circuitsathome.com Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com e-mail : support@circuitsathome.com
*/ */
#if !defined(__CONFDESCPARSER_H__) #if !defined(_usb_h_) || defined(__CONFDESCPARSER_H__)
#error "Never include confdescparser.h directly; include Usb.h instead"
#else
#define __CONFDESCPARSER_H__ #define __CONFDESCPARSER_H__
#include <inttypes.h>
#include <avr/pgmspace.h>
#include "message.h"
#include "parsetools.h"
//#include "hid.h"
class UsbConfigXtracter { class UsbConfigXtracter {
public: public:

View file

@ -14,14 +14,11 @@ Circuits At Home, LTD
Web : http://www.circuitsathome.com Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com e-mail : support@circuitsathome.com
*/ */
#if !defined(__HEXDUMP_H__) #if !defined(_usb_h_) || defined(__HEXDUMP_H__)
#error "Never include hexdump.h directly; include Usb.h instead"
#else
#define __HEXDUMP_H__ #define __HEXDUMP_H__
#include <inttypes.h>
#include <avr/pgmspace.h>
#include "printhex.h"
#include "message.h"
extern int UsbDEBUGlvl; extern int UsbDEBUGlvl;
template <class BASE_CLASS, class LEN_TYPE, class OFFSET_TYPE> template <class BASE_CLASS, class LEN_TYPE, class OFFSET_TYPE>

6
hid.h
View file

@ -18,12 +18,6 @@ e-mail : support@circuitsathome.com
#define __HID_H__ #define __HID_H__
#include "Usb.h" #include "Usb.h"
#include <avr/pgmspace.h>
#include "printhex.h"
#include "hexdump.h"
#include "confdescparser.h"
#include "hidusagestr.h" #include "hidusagestr.h"
#define DATA_SIZE_MASK 0x03 #define DATA_SIZE_MASK 0x03

View file

@ -7,8 +7,6 @@
#endif #endif
#include "Usb.h" #include "Usb.h"
#include <avr/pgmspace.h>
#include <confdescparser.h>
#define bmREQ_MASSOUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE #define bmREQ_MASSOUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
#define bmREQ_MASSIN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE #define bmREQ_MASSIN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE

View file

@ -14,11 +14,14 @@ Circuits At Home, LTD
Web : http://www.circuitsathome.com Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com e-mail : support@circuitsathome.com
*/ */
/* MAX3421E register/bit names and bitmasks */ #if !defined(_usb_h_) || defined(_max3421e_h_)
#error "Never include max3421e.h directly; include Usb.h instead"
#else
#ifndef _max3421e_h_
#define _max3421e_h_ #define _max3421e_h_
/* MAX3421E register/bit names and bitmasks */
/* Arduino pin definitions */ /* Arduino pin definitions */
/* pin numbers to port numbers */ /* pin numbers to port numbers */

View file

@ -15,17 +15,7 @@ Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com e-mail : support@circuitsathome.com
*/ */
#include "max_LCD.h" #include "max_LCD.h"
#include "max3421e.h"
#include <stdio.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
// pin definition and set/clear // pin definition and set/clear

View file

@ -21,9 +21,8 @@ e-mail : support@circuitsathome.com
#ifndef _Max_LCD_h_ #ifndef _Max_LCD_h_
#define _Max_LCD_h_ #define _Max_LCD_h_
#include <inttypes.h>
#include "Print.h"
#include "Usb.h" #include "Usb.h"
#include "Print.h"
// commands // commands
#define LCD_CLEARDISPLAY 0x01 #define LCD_CLEARDISPLAY 0x01

View file

@ -15,7 +15,7 @@ Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com e-mail : support@circuitsathome.com
*/ */
#include "message.h" #include "Usb.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.
// this allows for 126 other debugging levels. // this allows for 126 other debugging levels.
// TO-DO: Allow assignment to a different serial port // TO-DO: Allow assignment to a different serial port

View file

@ -14,16 +14,13 @@ Circuits At Home, LTD
Web : http://www.circuitsathome.com Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com e-mail : support@circuitsathome.com
*/ */
#if !defined(__MESSAGE_H__) #if !defined(_usb_h_) || defined(__MESSAGE_H__)
#error "Never include message.h directly; include Usb.h instead"
#else
#define __MESSAGE_H__ #define __MESSAGE_H__
#include "settings.h"
#include <inttypes.h>
#include <avr/pgmspace.h>
extern int UsbDEBUGlvl; extern int UsbDEBUGlvl;
#include "printhex.h"
void E_Notify(char const * msg, int lvl); void E_Notify(char const * msg, int lvl);
void E_Notify(uint8_t b, int lvl); void E_Notify(uint8_t b, int lvl);
void E_NotifyStr(char const * msg, int lvl); void E_NotifyStr(char const * msg, int lvl);
@ -78,6 +75,6 @@ void ErrorMessage(char const * msg, ERROR_TYPE rcode = 0) {
#endif #endif
} }
#include "hexdump.h" //#include "hexdump.h"
#endif // __MESSAGE_H__ #endif // __MESSAGE_H__

View file

@ -14,7 +14,7 @@ Circuits At Home, LTD
Web : http://www.circuitsathome.com Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com e-mail : support@circuitsathome.com
*/ */
#include "parsetools.h" #include "Usb.h"
bool MultiByteValueParser::Parse(uint8_t **pp, uint16_t *pcntdn) { bool MultiByteValueParser::Parse(uint8_t **pp, uint16_t *pcntdn) {
if (!pBuf) { if (!pBuf) {

View file

@ -14,20 +14,10 @@ Circuits At Home, LTD
Web : http://www.circuitsathome.com Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com e-mail : support@circuitsathome.com
*/ */
#if !defined(__PARSETOOLS_H__) #if !defined(_usb_h_) || defined(__PARSETOOLS_H__)
#define __PARSETOOLS_H__ #error "Never include parsetools.h directly; include Usb.h instead"
#include <inttypes.h>
#include <avr/pgmspace.h>
#include "message.h"
//#include "printhex.h"
//#include "hexdump.h"
#if defined(ARDUINO) && ARDUINO >=100
#include "Arduino.h"
#else #else
#include <WProgram.h> #define __PARSETOOLS_H__
#endif
struct MultiValueBuffer { struct MultiValueBuffer {
uint8_t valueSize; uint8_t valueSize;

View file

@ -14,10 +14,11 @@ Circuits At Home, LTD
Web : http://www.circuitsathome.com Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com e-mail : support@circuitsathome.com
*/ */
#if !defined(__PRINTHEX_H__)
#define __PRINTHEX_H__
#include "settings.h" #if !defined(_usb_h_) || defined(__PRINTHEX_H__)
#error "Never include printhex.h directly; include Usb.h instead"
#else
#define __PRINTHEX_H__
void E_Notifyc(char c, int lvl); void E_Notifyc(char c, int lvl);

View file

@ -33,9 +33,6 @@
#endif #endif
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// AUTOMATIC Settings // AUTOMATIC Settings
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -48,6 +45,7 @@
#if defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) #if defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
#define BOARD_TEENSY_PLUS_PLUS #define BOARD_TEENSY_PLUS_PLUS
#endif #endif
#include <avr/pgmspace.h>
#endif /* SETTINGS_H */ #endif /* SETTINGS_H */

View file

@ -18,8 +18,6 @@ e-mail : support@circuitsathome.com
#ifndef _ch9_h_ #ifndef _ch9_h_
#define _ch9_h_ #define _ch9_h_
#include <inttypes.h>
/* Misc.USB constants */ /* Misc.USB constants */
#define DEV_DESCR_LEN 18 //device descriptor length #define DEV_DESCR_LEN 18 //device descriptor length
#define CONF_DESCR_LEN 9 //configuration descriptor length #define CONF_DESCR_LEN 9 //configuration descriptor length

View file

@ -15,13 +15,13 @@ Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com e-mail : support@circuitsathome.com
*/ */
/* MAX3421E-based USB Host Library header file */ /* MAX3421E-based USB Host Library header file */
#ifndef _USBHOST_H_
#if !defined(_usb_h_) || defined(_USBHOST_H_)
#error "Never include usbhost.h directly; include Usb.h instead"
#else
#define _USBHOST_H_ #define _USBHOST_H_
#include "avrpins.h"
#include "max3421e.h"
#include "usb_ch9.h"
#include <stdio.h>
/* SPI initialization */ /* SPI initialization */
template< typename CLK, typename MOSI, typename MISO, typename SPI_SS > class SPi { template< typename CLK, typename MOSI, typename MISO, typename SPI_SS > class SPi {
public: public:

View file

@ -18,7 +18,6 @@ e-mail : support@circuitsathome.com
#define __USBHUB_H__ #define __USBHUB_H__
#include "Usb.h" #include "Usb.h"
#include <avr/pgmspace.h>
#define USB_DESCRIPTOR_HUB 0x09 // Hub descriptor type #define USB_DESCRIPTOR_HUB 0x09 // Hub descriptor type