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_
#include "Usb.h"
#include "confdescparser.h"
//PID and VID of the Sony PS3 devices
#define PS3_VID 0x054C // Sony Corporation

View file

@ -18,12 +18,6 @@
#ifndef _ps3usb_h_
#define _ps3usb_h_
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "Usb.h"
#include "PS3Enums.h"
@ -267,7 +261,7 @@ private:
*/
void onInit();
void (*pFuncOnInit)(void); // Pointer to function called in onInit()
bool bPollEnable;
uint32_t timer; // used to continuously set PS3 Move controller Bulb and rumble values

16
Usb.h
View file

@ -22,11 +22,19 @@ e-mail : support@circuitsathome.com
// Not used anymore?
//#define USB_METHODS_INLINE
//#include <assert.h>
#include <inttypes.h>
#include <stddef.h>
#include <stdio.h>
#include "settings.h"
#include "address.h"
#include "usbhost.h"
#include "printhex.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 */
#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)
#include "parsetools.h"
#include "confdescparser.h"
#endif //_usb_h_

View file

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

View file

@ -20,12 +20,6 @@
#ifndef _xboxrecv_h_
#define _xboxrecv_h_
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "Usb.h"
#include "xboxEnums.h"
@ -135,7 +129,7 @@ public:
/** @name Xbox Controller functions */
/**
* Return the analog value from the joysticks on the controller.
* Return the analog value from the joysticks on the controller.
* @param a Either ::LeftHatX, ::LeftHatY, ::RightHatX or ::RightHatY.
* @param controller The controller to read from. Default to 0.
* @return Returns a signed 16-bit integer.
@ -159,7 +153,7 @@ public:
setRumbleOn(0, 0, controller);
};
/**
* Turn rumble on.
* Turn rumble on.
* @param lValue Left motor (big weight) inside the controller.
* @param rValue Right motor (small weight) inside the controller.
* @param controller The controller to write to. Default to 0.
@ -182,19 +176,19 @@ public:
setLedRaw(0, controller);
};
/**
* Turn on a LED by using the ::LED enum.
* Turn on a LED by using the ::LED enum.
* @param l ::LED1, ::LED2, ::LED3 and ::LED4 is supported by the Xbox controller.
* @param controller The controller to write to. Default to 0.
*/
void setLedOn(LED l, uint8_t controller = 0);
/**
* Turn on a LED by using the ::LED enum.
* Turn on a LED by using the ::LED enum.
* @param l ::ALL, ::LED1, ::LED2, ::LED3 and ::LED4 is supported by the Xbox controller.
* @param controller The controller to write to. Default to 0.
*/
void setLedBlink(LED l, uint8_t controller = 0);
/**
* Used to set special LED modes supported by the Xbox controller.
* Used to set special LED modes supported by the Xbox controller.
* @param lm See ::LEDMode.
* @param controller The controller to write to. Default to 0.
*/

View file

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

View file

@ -14,12 +14,12 @@ Circuits At Home, LTD
Web : http://www.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__
#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 */

6
adk.h
View file

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

View file

@ -18,12 +18,6 @@ e-mail : support@circuitsathome.com
#define __CDCACM_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_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__
#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_IN 0xc0

View file

@ -14,16 +14,12 @@ Circuits At Home, LTD
Web : http://www.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__
#include <inttypes.h>
#include <avr/pgmspace.h>
#include "message.h"
#include "parsetools.h"
//#include "hid.h"
class UsbConfigXtracter {
public:

View file

@ -14,14 +14,11 @@ Circuits At Home, LTD
Web : http://www.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__
#include <inttypes.h>
#include <avr/pgmspace.h>
#include "printhex.h"
#include "message.h"
extern int UsbDEBUGlvl;
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__
#include "Usb.h"
#include <avr/pgmspace.h>
#include "printhex.h"
#include "hexdump.h"
#include "confdescparser.h"
#include "hidusagestr.h"
#define DATA_SIZE_MASK 0x03

View file

@ -7,8 +7,6 @@
#endif
#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_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
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_
/* MAX3421E register/bit names and bitmasks */
/* Arduino pin definitions */
/* pin numbers to port numbers */

View file

@ -15,17 +15,7 @@ Web : http://www.circuitsathome.com
e-mail : support@circuitsathome.com
*/
#include "max_LCD.h"
#include "max3421e.h"
#include <stdio.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

View file

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

View file

@ -15,7 +15,7 @@ Web : http://www.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.
// this allows for 126 other debugging levels.
// TO-DO: Allow assignment to a different serial port

View file

@ -14,16 +14,13 @@ Circuits At Home, LTD
Web : http://www.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__
#include "settings.h"
#include <inttypes.h>
#include <avr/pgmspace.h>
extern int UsbDEBUGlvl;
#include "printhex.h"
void E_Notify(char const * msg, int lvl);
void E_Notify(uint8_t b, int lvl);
void E_NotifyStr(char const * msg, int lvl);
@ -78,6 +75,6 @@ void ErrorMessage(char const * msg, ERROR_TYPE rcode = 0) {
#endif
}
#include "hexdump.h"
//#include "hexdump.h"
#endif // __MESSAGE_H__

View file

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

View file

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

View file

@ -14,10 +14,11 @@ Circuits At Home, LTD
Web : http://www.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);

View file

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

View file

@ -18,8 +18,6 @@ e-mail : support@circuitsathome.com
#ifndef _ch9_h_
#define _ch9_h_
#include <inttypes.h>
/* Misc.USB constants */
#define DEV_DESCR_LEN 18 //device 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
*/
/* 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_
#include "avrpins.h"
#include "max3421e.h"
#include "usb_ch9.h"
#include <stdio.h>
/* SPI initialization */
template< typename CLK, typename MOSI, typename MISO, typename SPI_SS > class SPi {
public:

View file

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