|
@@ -54,8 +54,13 @@
|
54
|
54
|
#endif
|
55
|
55
|
|
56
|
56
|
#include "../../core/serial_hook.h"
|
57
|
|
-typedef Serial1Class<decltype(Serial)> DefaultSerial1;
|
58
|
|
-extern DefaultSerial1 MSerial0;
|
|
57
|
+
|
|
58
|
+#define Serial0 Serial
|
|
59
|
+#define _DECLARE_SERIAL(X) \
|
|
60
|
+ typedef Serial1Class<decltype(Serial##X)> DefaultSerial##X; \
|
|
61
|
+ extern DefaultSerial##X MSerial##X
|
|
62
|
+#define DECLARE_SERIAL(X) _DECLARE_SERIAL(X)
|
|
63
|
+
|
59
|
64
|
typedef ForwardSerial1Class<decltype(SerialUSB)> USBSerialType;
|
60
|
65
|
extern USBSerialType USBSerial;
|
61
|
66
|
|
|
@@ -66,6 +71,7 @@ extern USBSerialType USBSerial;
|
66
|
71
|
#define MYSERIAL1 USBSerial
|
67
|
72
|
#elif WITHIN(SERIAL_PORT, 0, 3)
|
68
|
73
|
#define MYSERIAL1 MSERIAL(SERIAL_PORT)
|
|
74
|
+ DECLARE_SERIAL(SERIAL_PORT);
|
69
|
75
|
#endif
|
70
|
76
|
|
71
|
77
|
#define HAL_SERVO_LIB libServo
|