mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Automatically detect if a Teensy is connected
This commit is contained in:
parent
822519b2ce
commit
86f88e5333
4 changed files with 5 additions and 15 deletions
|
@ -73,7 +73,8 @@ Currently the following boards are supported by the library:
|
||||||
|
|
||||||
The following boards need to be activated manually in [settings.h](settings.h):
|
The following boards need to be activated manually in [settings.h](settings.h):
|
||||||
|
|
||||||
* Arduino Mega ADK, Teensy 2.0 and Black Widdow.
|
* Arduino Mega ADK
|
||||||
|
* Black Widdow
|
||||||
|
|
||||||
Simply set the corresponding value to 1 instead of 0.
|
Simply set the corresponding value to 1 instead of 0.
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
/* 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
|
||||||
typedef MAX3421e<P6, P3> MAX3421E; // Black Widow
|
typedef MAX3421e<P6, P3> MAX3421E; // Black Widow
|
||||||
#elif defined(BOARD_TEENSY_PLUS_PLUS)
|
#elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__))
|
||||||
typedef MAX3421e<P9, P8> MAX3421E; // Teensy++ 2.0 & 1.0
|
typedef MAX3421e<P9, P8> MAX3421E; // Teensy++ 2.0 & 1.0
|
||||||
#elif defined(BOARD_MEGA_ADK)
|
#elif defined(BOARD_MEGA_ADK)
|
||||||
typedef MAX3421e<P53, P54> MAX3421E; // Arduino Mega ADK
|
typedef MAX3421e<P53, P54> MAX3421E; // Arduino Mega ADK
|
||||||
|
|
|
@ -25,14 +25,10 @@ e-mail : support@circuitsathome.com
|
||||||
// Support for these boards needs to be manually activated in settings.h or in a makefile
|
// Support for these boards needs to be manually activated in settings.h or in a makefile
|
||||||
#if !defined(BOARD_MEGA_ADK) && defined(__AVR_ATmega2560__) && USE_UHS_MEGA_ADK
|
#if !defined(BOARD_MEGA_ADK) && defined(__AVR_ATmega2560__) && USE_UHS_MEGA_ADK
|
||||||
#define BOARD_MEGA_ADK
|
#define BOARD_MEGA_ADK
|
||||||
#elif !defined(BOARD_TEENSY) && USE_UHS_TEENSY
|
|
||||||
#define BOARD_TEENSY
|
|
||||||
#elif !defined(BOARD_BLACK_WIDDOW) && USE_UHS_BLACK_WIDDOW
|
#elif !defined(BOARD_BLACK_WIDDOW) && USE_UHS_BLACK_WIDDOW
|
||||||
#define BOARD_BLACK_WIDDOW
|
#define BOARD_BLACK_WIDDOW
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#include <avr/io.h>
|
|
||||||
|
|
||||||
#ifdef PORTA
|
#ifdef PORTA
|
||||||
#define USE_PORTA
|
#define USE_PORTA
|
||||||
#endif
|
#endif
|
||||||
|
@ -541,7 +537,7 @@ public:
|
||||||
|
|
||||||
// "Classic" Arduino pin numbers
|
// "Classic" Arduino pin numbers
|
||||||
|
|
||||||
#elif defined(BOARD_TEENSY) && defined(__AVR_ATmega32U4__)
|
#elif defined(CORE_TEENSY) && defined(__AVR_ATmega32U4__)
|
||||||
// Teensy 2.0 pin numbers
|
// Teensy 2.0 pin numbers
|
||||||
// http://www.pjrc.com/teensy/pinout.html
|
// http://www.pjrc.com/teensy/pinout.html
|
||||||
#define P0 Pb0
|
#define P0 Pb0
|
||||||
|
@ -611,7 +607,7 @@ public:
|
||||||
|
|
||||||
// Arduino Leonardo pin numbers
|
// Arduino Leonardo pin numbers
|
||||||
|
|
||||||
#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
|
#elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__))
|
||||||
// Teensy++ 2.0 pin numbers
|
// Teensy++ 2.0 pin numbers
|
||||||
// http://www.pjrc.com/teensy/pinout.html
|
// http://www.pjrc.com/teensy/pinout.html
|
||||||
#define P0 Pd0
|
#define P0 Pd0
|
||||||
|
|
|
@ -31,9 +31,6 @@
|
||||||
/* Set this to 1 if you are using an Arduino Mega ADK board with MAX3421e built-in */
|
/* Set this to 1 if you are using an Arduino Mega ADK board with MAX3421e built-in */
|
||||||
#define USE_UHS_MEGA_ADK 0
|
#define USE_UHS_MEGA_ADK 0
|
||||||
|
|
||||||
/* Set this to 1 if you are using a Teensy 1.0 or 2.0 */
|
|
||||||
#define USE_UHS_TEENSY 0
|
|
||||||
|
|
||||||
/* Set this to 1 if you are using a Black Widdow */
|
/* Set this to 1 if you are using a Black Widdow */
|
||||||
#define USE_UHS_BLACK_WIDDOW 0
|
#define USE_UHS_BLACK_WIDDOW 0
|
||||||
|
|
||||||
|
@ -58,10 +55,6 @@
|
||||||
#define DEBUG_USB_HOST
|
#define DEBUG_USB_HOST
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(BOARD_TEENSY_PLUS_PLUS) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__))
|
|
||||||
#define BOARD_TEENSY_PLUS_PLUS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// When will we drop support for the older bug-ridden stuff?
|
// When will we drop support for the older bug-ridden stuff?
|
||||||
#if defined(ARDUINO) && ARDUINO >=100
|
#if defined(ARDUINO) && ARDUINO >=100
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
Loading…
Reference in a new issue