Multi-host support

This commit is contained in:
Thomas Moore
2017-11-05 08:49:38 -06:00
committed by Scott Lahteine
parent dabb75034c
commit f7efac57b7
41 changed files with 1192 additions and 747 deletions

View File

@ -65,16 +65,41 @@
// Defines
// --------------------------------------------------------------------------
#if !WITHIN(SERIAL_PORT, -1, 3)
#error "SERIAL_PORT must be from -1 to 3"
#endif
#if SERIAL_PORT == -1
#define MYSERIAL SerialUSB
#define MYSERIAL0 SerialUSB
#elif SERIAL_PORT == 0
#define MYSERIAL Serial
#define MYSERIAL0 Serial
#elif SERIAL_PORT == 1
#define MYSERIAL Serial1
#define MYSERIAL0 Serial1
#elif SERIAL_PORT == 2
#define MYSERIAL Serial2
#define MYSERIAL0 Serial2
#elif SERIAL_PORT == 3
#define MYSERIAL Serial3
#define MYSERIAL0 Serial3
#endif
#ifdef SERIAL_PORT_2
#if !WITHIN(SERIAL_PORT_2, -1, 3)
#error "SERIAL_PORT_2 must be from -1 to 3"
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#endif
#define NUM_SERIAL 2
#if SERIAL_PORT_2 == -1
#define MYSERIAL1 SerialUSB
#elif SERIAL_PORT_2 == 0
#define MYSERIAL1 Serial
#elif SERIAL_PORT_2 == 1
#define MYSERIAL1 Serial1
#elif SERIAL_PORT_2 == 2
#define MYSERIAL1 Serial2
#elif SERIAL_PORT_2 == 3
#define MYSERIAL1 Serial3
#endif
#else
#define NUM_SERIAL 1
#endif
/**