Skip to content

Commit 36bf192

Browse files
committed
Don't build AltSoftSerial by default in examples
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
1 parent 53a0cf8 commit 36bf192

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

examples/getSetAddress/getSetAddress.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@ const int DEREPin = -1; // The pin controlling Receive Enable and Driver
7676
// Hardware serial ports are preferred when available.
7777
// AltSoftSerial is the most stable alternative for modbus.
7878
// Select over alternatives with the define below.
79-
#define BUILD_ALTSOFTSERIAL // Comment-out if you prefer alternatives
79+
// #define BUILD_ALTSOFTSERIAL // Comment-out if you prefer alternatives
8080

8181
#if defined(BUILD_ALTSOFTSERIAL)
8282
#include <AltSoftSerial.h>
8383
AltSoftSerial modbusSerial;
8484

85-
#elif defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_FEATHER328P)
85+
#elif defined(BUILD_SOFTWARE_SERIAL) && \
86+
(defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_FEATHER328P))
8687
// The Uno only has 1 hardware serial port, which is dedicated to communication with the
8788
// computer. If using an Uno, you will be restricted to using AltSofSerial or
8889
// SoftwareSerial

examples/readWriteRegister/readWriteRegister.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ const int DEREPin = -1; // The pin controlling Receive Enable and Driver
5757
// Hardware serial ports are preferred when available.
5858
// AltSoftSerial is the most stable alternative for modbus.
5959
// Select over alternatives with the define below.
60-
#define BUILD_ALTSOFTSERIAL // Comment-out if you prefer alternatives
60+
// #define BUILD_ALTSOFTSERIAL // Comment-out if you prefer alternatives
6161

6262
#if defined(BUILD_ALTSOFTSERIAL)
6363
#include <AltSoftSerial.h>
6464
AltSoftSerial modbusSerial;
6565

66-
#elif defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_FEATHER328P)
66+
#elif defined(BUILD_SOFTWARE_SERIAL) && \
67+
(defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_FEATHER328P))
6768
// The Uno only has 1 hardware serial port, which is dedicated to communication with the
6869
// computer. If using an Uno, you will be restricted to using AltSofSerial or
6970
// SoftwareSerial

0 commit comments

Comments
 (0)