Automatically detect if a Teensy is connected

This commit is contained in:
Kristian Sloth Lauszus 2013-10-05 00:21:16 +02:00
parent 822519b2ce
commit 86f88e5333
4 changed files with 5 additions and 15 deletions

View file

@ -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):
* Arduino Mega ADK, Teensy 2.0 and Black Widdow.
* Arduino Mega ADK
* Black Widdow
Simply set the corresponding value to 1 instead of 0.

View file

@ -17,7 +17,7 @@
/* shield pins. First parameter - SS pin, second parameter - INT pin */
#ifdef BOARD_BLACK_WIDDOW
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
#elif defined(BOARD_MEGA_ADK)
typedef MAX3421e<P53, P54> MAX3421E; // Arduino Mega ADK

View file

@ -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
#if !defined(BOARD_MEGA_ADK) && defined(__AVR_ATmega2560__) && USE_UHS_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
#define BOARD_BLACK_WIDDOW
#endif
//#include <avr/io.h>
#ifdef PORTA
#define USE_PORTA
#endif
@ -541,7 +537,7 @@ public:
// "Classic" Arduino pin numbers
#elif defined(BOARD_TEENSY) && defined(__AVR_ATmega32U4__)
#elif defined(CORE_TEENSY) && defined(__AVR_ATmega32U4__)
// Teensy 2.0 pin numbers
// http://www.pjrc.com/teensy/pinout.html
#define P0 Pb0
@ -611,7 +607,7 @@ public:
// 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
// http://www.pjrc.com/teensy/pinout.html
#define P0 Pd0

View file

@ -31,9 +31,6 @@
/* Set this to 1 if you are using an Arduino Mega ADK board with MAX3421e built-in */
#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 */
#define USE_UHS_BLACK_WIDDOW 0
@ -58,10 +55,6 @@
#define DEBUG_USB_HOST
#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?
#if defined(ARDUINO) && ARDUINO >=100
#include <Arduino.h>