Skip to content

Commit f002129

Browse files
authored
Fix _serialTransmissionBufferLength on Non-MegaAVR (#73)
Fix _serialTransmissionBufferLength that was broken with MegaAVR support Instead of assuming which define a core will use, just check to see which define exists.
1 parent 255fd62 commit f002129

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ModbusSlave.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ class Modbus
136136

137137
Stream &_serialStream;
138138

139-
#if defined ARDUINO_ARCH_AVR || defined AVR_NANO_EVERY || defined AVR_UNO_WIFI_REV2
140-
int _serialTransmissionBufferLength = SERIAL_BUFFER_SIZE;
141-
#else
139+
#if defined(SERIAL_TX_BUFFER_SIZE)
142140
int _serialTransmissionBufferLength = SERIAL_TX_BUFFER_SIZE;
141+
#else
142+
int _serialTransmissionBufferLength = SERIAL_BUFFER_SIZE;
143143
#endif
144144

145145
int _transmissionControlPin = MODBUS_CONTROL_PIN_NONE;

0 commit comments

Comments
 (0)