diff --git a/Usb.h b/Usb.h index 7e9113fb..9432b4b0 100644 --- a/Usb.h +++ b/Usb.h @@ -49,9 +49,10 @@ e-mail : support@circuitsathome.com #ifdef BOARD_BLACK_WIDDOW typedef MAX3421e MAX3421E; // Black Widow +#elif defined(BOARD_MEGA_ADK) +typedef MAX3421e MAX3421E; // Arduino Mega ADK #else -//typedef MAX3421e MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560 -typedef MAX3421e MAX3421E; // Arduino Mega ADK +typedef MAX3421e MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560 #endif //Debug macros. In 1.0 it is possible to move strings to PROGMEM by defining USBTRACE (Serial.print(F(s))) diff --git a/avrpins.h b/avrpins.h index 99e10776..d2297a6b 100644 --- a/avrpins.h +++ b/avrpins.h @@ -20,6 +20,9 @@ e-mail : support@circuitsathome.com #ifndef _avrpins_h_ #define _avrpins_h_ +/* Uncomment the following if you have Arduino Mega ADK board with MAX3421e built-in */ +#define BOARD_MEGA_ADK + #include #ifdef PORTA @@ -465,6 +468,7 @@ template #define P51 Pb2 #define P52 Pb1 #define P53 Pb0 +#define P54 Pj2 #endif //"Mega" pin numbers diff --git a/usbhost.h b/usbhost.h index b86101e8..a94b42e1 100644 --- a/usbhost.h +++ b/usbhost.h @@ -86,10 +86,12 @@ MAX3421e< SS, INTR >::MAX3421e() SS::Set(); spi::init(); INTR::SetDirRead(); - + +#ifdef BOARD_MEGA_ADK /* For Mega ADK, which has Max3421e on-board, set MAX_RESET to Output mode, and pull Reset to HIGH */ DDRJ |= 0x04; PORTJ |= 0x04; +#endif /* MAX3421E - full-duplex SPI, level interrupt */ regWr( rPINCTL,( bmFDUPSPI + bmINTLEVEL ));