Skip to content

Commit 5fab4db

Browse files
committed
Remove Arduino Compiler Warnings on SERIAL_8[EN][12] re-definitions
1 parent d7812bc commit 5fab4db

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/DMXSerial2.cpp

+14-3
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,22 @@ unsigned long _timingReceiveEnd; // when the last incoming byte was received
142142
#endif
143143

144144

145-
// formats for serial transmission, already defined in "Arduino.h"->"HardwareSerial.h"
146-
#define SERIAL_8N1 ((0<<USBSn) | (0<<UPMn0) | (3<<UCSZn0))
145+
// The formats for serial transmission, already defined in `Arduino.h` -> `HardwareSerial.h`
146+
// We do not include `HardwareSerial.h` but home it's still there in future version.
147+
// If not, here are the required values:
148+
149+
#ifndef SERIAL_8N2
147150
#define SERIAL_8N2 ((1<<USBSn) | (0<<UPMn0) | (3<<UCSZn0))
151+
#endif
152+
153+
#ifndef SERIAL_8E1
148154
#define SERIAL_8E1 ((0<<USBSn) | (2<<UPMn0) | (3<<UCSZn0))
149-
#define SERIAL_8E2 ((1<<USBSn) | (2<<UPMn0) | (3<<UCSZn0))
155+
#endif
156+
157+
// not needed by DMXSerial2:
158+
// #define SERIAL_8N1 ((0<<USBSn) | (0<<UPMn0) | (3<<UCSZn0))
159+
// #define SERIAL_8E2 ((1<<USBSn) | (2<<UPMn0) | (3<<UCSZn0))
160+
150161

151162
// the break timing is 10 bits (start + 8 data + parity) of this speed
152163
// the mark-after-break is 1 bit of this speed plus approx 6 usec

0 commit comments

Comments
 (0)