|
39 | 39 |
|
40 | 40 | #define _IMPLEMENT_SERIAL(X) DefaultSerial##X MSerial##X(false, Serial##X)
|
41 | 41 | #define IMPLEMENT_SERIAL(X) _IMPLEMENT_SERIAL(X)
|
42 |
| -#if WITHIN(SERIAL_PORT, 0, 8) |
| 42 | +#if WITHIN(SERIAL_PORT, SERIAL_INDEX_MIN, SERIAL_INDEX_MAX) |
43 | 43 | IMPLEMENT_SERIAL(SERIAL_PORT);
|
44 | 44 | #endif
|
45 |
| -#ifdef SERIAL_PORT_2 |
46 |
| - #if WITHIN(SERIAL_PORT_2, 0, 8) |
47 |
| - IMPLEMENT_SERIAL(SERIAL_PORT_2); |
48 |
| - #endif |
| 45 | +#if defined(SERIAL_PORT_2) && WITHIN(SERIAL_PORT_2, SERIAL_INDEX_MIN, SERIAL_INDEX_MAX) |
| 46 | + IMPLEMENT_SERIAL(SERIAL_PORT_2); |
49 | 47 | #endif
|
50 |
| -#ifdef SERIAL_PORT_3 |
51 |
| - #if WITHIN(SERIAL_PORT_3, 0, 8) |
52 |
| - IMPLEMENT_SERIAL(SERIAL_PORT_3); |
53 |
| - #endif |
| 48 | +#if defined(SERIAL_PORT_3) && WITHIN(SERIAL_PORT_3, SERIAL_INDEX_MIN, SERIAL_INDEX_MAX) |
| 49 | + IMPLEMENT_SERIAL(SERIAL_PORT_3); |
| 50 | +#endif |
| 51 | +#if defined(MMU_SERIAL_PORT) && WITHIN(MMU_SERIAL_PORT, SERIAL_INDEX_MIN, SERIAL_INDEX_MAX) |
| 52 | + IMPLEMENT_SERIAL(MMU_SERIAL_PORT); |
| 53 | +#endif |
| 54 | +#if defined(LCD_SERIAL_PORT) && WITHIN(LCD_SERIAL_PORT, SERIAL_INDEX_MIN, SERIAL_INDEX_MAX) |
| 55 | + IMPLEMENT_SERIAL(LCD_SERIAL_PORT); |
54 | 56 | #endif
|
55 | 57 | USBSerialType USBSerial(false, SerialUSB);
|
56 | 58 |
|
|
0 commit comments