From 82c52542cc522982b026bf7f6cdd9059e5064d4a Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Mon, 21 Oct 2013 02:17:47 +0200 Subject: [PATCH] Use pin definition in avrpins.h to set MAX_RESET pin on Arduino ADK --- avrpins.h | 4 ++++ usbhost.h | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/avrpins.h b/avrpins.h index 5eb679fb..5a7e1756 100644 --- a/avrpins.h +++ b/avrpins.h @@ -510,7 +510,11 @@ public: #define P51 Pb2 #define P52 Pb1 #define P53 Pb0 + +#ifdef BOARD_MEGA_ADK // These pins are not broken out on the Arduino ADK #define P54 Pe6 // INT on Arduino ADK +#define P55 Pj2 // MAX_RESET on Arduino ADK +#endif // "Mega" pin numbers diff --git a/usbhost.h b/usbhost.h index 26b8036f..5a8ca4bb 100644 --- a/usbhost.h +++ b/usbhost.h @@ -95,10 +95,9 @@ template< typename SS, typename INTR > MAX3421e< SS, INTR >::MAX3421e() { // Leaving ADK hardware setup in here, for now. This really belongs with the other parts. #ifdef BOARD_MEGA_ADK - /* For Mega ADK, which has Max3421e on-board, set MAX_RESET to Output mode, and pull Reset to HIGH */ - DDRJ |= _BV(PJ2); - PORTJ &= ~_BV(PJ2); - PORTJ |= _BV(PJ2); + // For Mega ADK, which has a Max3421e on-board, set MAX_RESET to output mode, and then set it to HIGH + P55::SetDirWrite(); + P55::Set(); #endif };