Skip to content

Commit

Permalink
Pins debugging AVR serial pins (#16437)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored and thinkyhead committed Jan 3, 2020
1 parent 64fdc4f commit d7aee3b
Showing 1 changed file with 79 additions and 7 deletions.
86 changes: 79 additions & 7 deletions Marlin/src/pins/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,35 @@
#line 46

// manually add pins that have names that are macros which don't play well with these macros
#if SERIAL_PORT == 0 && (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY || defined(ARDUINO_ARCH_SAM))
static const char RXD_NAME[] PROGMEM = { "RXD" };
static const char TXD_NAME[] PROGMEM = { "TXD" };
#if (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY || defined(ARDUINO_ARCH_SAM))
#if SERIAL_PORT == 0
static const char RXD_NAME_0[] PROGMEM = { "RXD0" };
static const char TXD_NAME_0[] PROGMEM = { "TXD0" };
#elif SERIAL_PORT == 1
static const char RXD_NAME_1[] PROGMEM = { "RXD1" };
static const char TXD_NAME_1[] PROGMEM = { "TXD1" };
#elif SERIAL_PORT == 2
static const char RXD_NAME_2[] PROGMEM = { "RXD2" };
static const char TXD_NAME_2[] PROGMEM = { "TXD2" };
#elif SERIAL_PORT == 3
static const char RXD_NAME_3[] PROGMEM = { "RXD3" };
static const char TXD_NAME_3[] PROGMEM = { "TXD3" };
#endif
#ifdef SERIAL_PORT_2
#if SERIAL_PORT_2 == 0
static const char RXD_NAME_0[] PROGMEM = { "RXD0" };
static const char TXD_NAME_0[] PROGMEM = { "TXD0" };
#elif SERIAL_PORT_2 == 1
static const char RXD_NAME_1[] PROGMEM = { "RXD1" };
static const char TXD_NAME_1[] PROGMEM = { "TXD1" };
#elif SERIAL_PORT_2 == 2
static const char RXD_NAME_2[] PROGMEM = { "RXD2" };
static const char TXD_NAME_2[] PROGMEM = { "TXD2" };
#elif SERIAL_PORT_2 == 3
static const char RXD_NAME_3[] PROGMEM = { "RXD3" };
static const char TXD_NAME_3[] PROGMEM = { "TXD3" };
#endif
#endif
#endif

/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -85,11 +111,57 @@ const PinInfo pin_array[] PROGMEM = {
// manually add pins ...
#if SERIAL_PORT == 0
#if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
{ RXD_NAME, 0, true },
{ TXD_NAME, 1, true },
{ RXD_NAME_0, 0, true },
{ TXD_NAME_0, 1, true },
#elif AVR_ATmega1284_FAMILY
{ RXD_NAME_0, 8, true },
{ TXD_NAME_0, 9, true },
#endif
#elif SERIAL_PORT == 1
#if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
{ RXD_NAME_1, 19, true },
{ TXD_NAME_1, 18, true },
#elif AVR_ATmega1284_FAMILY
{ RXD_NAME, 8, true },
{ TXD_NAME, 9, true },
{ RXD_NAME_1, 10, true },
{ TXD_NAME_1, 11, true },
#endif
#elif SERIAL_PORT == 2
#if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
{ RXD_NAME_2, 17, true },
{ TXD_NAME_2, 16, true },
#endif
#elif SERIAL_PORT == 3
#if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
{ RXD_NAME_3, 15, true },
{ TXD_NAME_3, 14, true },
#endif
#endif

#if SERIAL_PORT_2 == 0
#if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
{ RXD_NAME_0, 0, true },
{ TXD_NAME_0, 1, true },
#elif AVR_ATmega1284_FAMILY
{ RXD_NAME_0, 8, true },
{ TXD_NAME_0, 9, true },
#endif
#elif SERIAL_PORT_2 == 1
#if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
{ RXD_NAME_1, 19, true },
{ TXD_NAME_1, 18, true },
#elif AVR_ATmega1284_FAMILY
{ RXD_NAME_1, 10, true },
{ TXD_NAME_1, 11, true },
#endif
#elif SERIAL_PORT_2 == 2
#if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
{ RXD_NAME_2, 17, true },
{ TXD_NAME_2, 16, true },
#endif
#elif SERIAL_PORT_2 == 3
#if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM))
{ RXD_NAME_3, 15, true },
{ TXD_NAME_3, 14, true },
#endif
#endif

Expand Down

0 comments on commit d7aee3b

Please sign in to comment.