Skip to content

Commit fa23f02

Browse files
committed
Reverts etc for a better version upgrade experience
1 parent 0408552 commit fa23f02

File tree

7 files changed

+54
-53
lines changed

7 files changed

+54
-53
lines changed

examples/bitpattern/bitpattern.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void setup() {
3939
#endif
4040
logSer.begin(115200);
4141
logSer.println(PSTR("\nOne Wire Half Duplex Bitpattern and Datarate Test"));
42-
swSer.begin(TESTBPS, EspSoftwareSerial::SERIAL_8N1, D6, D5);
42+
swSer.begin(TESTBPS, EspSoftwareSerial::SWSERIAL_8N1, D6, D5);
4343
swSer.enableIntTx(true);
4444
logSer.println(PSTR("Tx on swSer"));
4545
}

examples/loopback/loopback.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ constexpr int IUTBITRATE = 19200;
4747
#endif
4848

4949
#if defined(ESP8266)
50-
constexpr EspSoftwareSerial::Config swSerialConfig = EspSoftwareSerial::SERIAL_8E1;
50+
constexpr EspSoftwareSerial::Config swSerialConfig = EspSoftwareSerial::SWSERIAL_8E1;
5151
constexpr SerialConfig hwSerialConfig = ::SERIAL_8E1;
5252
#elif defined(ESP32)
53-
constexpr EspSoftwareSerial::Config swSerialConfig = EspSoftwareSerial::SERIAL_8E1;
53+
constexpr EspSoftwareSerial::Config swSerialConfig = EspSoftwareSerial::SWSERIAL_8E1;
5454
constexpr uint32_t hwSerialConfig = ::SERIAL_8E1;
5555
#else
5656
constexpr unsigned swSerialConfig = 3;
@@ -102,7 +102,7 @@ void setup() {
102102
Serial.begin(IUTBITRATE, hwSerialConfig, ::SERIAL_FULL, 1, invert);
103103
Serial.swap();
104104
Serial.setRxBufferSize(2 * BLOCKSIZE);
105-
logger.begin(9600, EspSoftwareSerial::SERIAL_8N1, -1, TX);
105+
logger.begin(9600, EspSoftwareSerial::SWSERIAL_8N1, -1, TX);
106106
#else
107107
logger.begin(9600);
108108
#endif

examples/onewiretest/onewiretest.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ void setup() {
1717
delay(2000);
1818
Serial.begin(115200);
1919
Serial.println(PSTR("\nOne Wire Half Duplex Serial Tester"));
20-
swSer1.begin(115200, EspSoftwareSerial::SERIAL_8N1, D6, D6, false, 256);
20+
swSer1.begin(115200, EspSoftwareSerial::SWSERIAL_8N1, D6, D6, false, 256);
2121
// high speed half duplex, turn off interrupts during tx
2222
swSer1.enableIntTx(false);
23-
swSer2.begin(115200, EspSoftwareSerial::SERIAL_8N1, D5, D5, false, 256);
23+
swSer2.begin(115200, EspSoftwareSerial::SWSERIAL_8N1, D5, D5, false, 256);
2424
// high speed half duplex, turn off interrupts during tx
2525
swSer2.enableIntTx(false);
2626
}

examples/onreceive/onreceive.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void setup() {
3030
Serial.begin(115200);
3131
Serial.setDebugOutput(false);
3232
Serial.swap();
33-
testSerial.begin(BAUD_RATE, EspSoftwareSerial::SERIAL_8N1, RX, TX);
33+
testSerial.begin(BAUD_RATE, EspSoftwareSerial::SWSERIAL_8N1, RX, TX);
3434
// Only half duplex this way, but reliable TX timings for high bps
3535
testSerial.enableIntTx(false);
3636
testSerial.onReceive(receiveHandler);

examples/repeater/repeater.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ constexpr int IUTBITRATE = 19200;
3737
#endif
3838

3939
#if defined(ESP8266)
40-
constexpr EspSoftwareSerial::Config swSerialConfig = EspSoftwareSerial::SERIAL_8E1;
40+
constexpr EspSoftwareSerial::Config swSerialConfig = EspSoftwareSerial::SWSERIAL_8E1;
4141
constexpr SerialConfig hwSerialConfig = ::SERIAL_8E1;
4242
#elif defined(ESP32)
43-
constexpr EspSoftwareSerial::Config swSerialConfig = EspSoftwareSerial::SERIAL_8E1;
43+
constexpr EspSoftwareSerial::Config swSerialConfig = EspSoftwareSerial::SWSERIAL_8E1;
4444
constexpr uint32_t hwSerialConfig = ::SERIAL_8E1;
4545
#else
4646
constexpr unsigned swSerialConfig = 3;
@@ -83,7 +83,7 @@ void setup() {
8383
repeater.begin(IUTBITRATE, hwSerialConfig, ::SERIAL_FULL, 1, invert);
8484
repeater.swap();
8585
repeater.setRxBufferSize(2 * BLOCKSIZE);
86-
logger.begin(9600, EspSoftwareSerial::SERIAL_8N1, -1, TX);
86+
logger.begin(9600, EspSoftwareSerial::SWSERIAL_8N1, -1, TX);
8787
#else
8888
repeater.begin(IUTBITRATE, swSerialConfig, D7, D8, invert, 4 * BLOCKSIZE);
8989
#ifdef HALFDUPLEX

examples/swsertest/swsertest.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ void setup() {
5151
// to the loopback EspSoftwareSerial adapter gets read before another write is performed.
5252
// Block writes with a size greater than 1 would usually fail. Do not copy this into your own project without
5353
// reading the documentation.
54-
testSerial.begin(BAUD_RATE, EspSoftwareSerial::SERIAL_8N1, D7, D8, false, 95, 11);
54+
testSerial.begin(BAUD_RATE, EspSoftwareSerial::SWSERIAL_8N1, D7, D8, false, 95, 11);
5555
#else
5656
testSerial.begin(115200);
5757
testSerial.setDebugOutput(false);
5858
testSerial.swap();
59-
usbSerial.begin(BAUD_RATE, EspSoftwareSerial::SERIAL_8N1, RX, TX, false, 95);
59+
usbSerial.begin(BAUD_RATE, EspSoftwareSerial::SWSERIAL_8N1, RX, TX, false, 95);
6060
#endif
6161

6262
usbSerial.println(PSTR("\nSoftware serial test started"));

src/SoftwareSerial.h

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -111,46 +111,46 @@ enum Parity : uint8_t {
111111
};
112112

113113
enum Config {
114-
SERIAL_5N1 = PARITY_NONE,
115-
SERIAL_6N1,
116-
SERIAL_7N1,
117-
SERIAL_8N1,
118-
SERIAL_5E1 = PARITY_EVEN,
119-
SERIAL_6E1,
120-
SERIAL_7E1,
121-
SERIAL_8E1,
122-
SERIAL_5O1 = PARITY_ODD,
123-
SERIAL_6O1,
124-
SERIAL_7O1,
125-
SERIAL_8O1,
126-
SERIAL_5M1 = PARITY_MARK,
127-
SERIAL_6M1,
128-
SERIAL_7M1,
129-
SERIAL_8M1,
130-
SERIAL_5S1 = PARITY_SPACE,
131-
SERIAL_6S1,
132-
SERIAL_7S1,
133-
SERIAL_8S1,
134-
SERIAL_5N2 = 0200 | PARITY_NONE,
135-
SERIAL_6N2,
136-
SERIAL_7N2,
137-
SERIAL_8N2,
138-
SERIAL_5E2 = 0200 | PARITY_EVEN,
139-
SERIAL_6E2,
140-
SERIAL_7E2,
141-
SERIAL_8E2,
142-
SERIAL_5O2 = 0200 | PARITY_ODD,
143-
SERIAL_6O2,
144-
SERIAL_7O2,
145-
SERIAL_8O2,
146-
SERIAL_5M2 = 0200 | PARITY_MARK,
147-
SERIAL_6M2,
148-
SERIAL_7M2,
149-
SERIAL_8M2,
150-
SERIAL_5S2 = 0200 | PARITY_SPACE,
151-
SERIAL_6S2,
152-
SERIAL_7S2,
153-
SERIAL_8S2,
114+
SWSERIAL_5N1 = PARITY_NONE,
115+
SWSERIAL_6N1,
116+
SWSERIAL_7N1,
117+
SWSERIAL_8N1,
118+
SWSERIAL_5E1 = PARITY_EVEN,
119+
SWSERIAL_6E1,
120+
SWSERIAL_7E1,
121+
SWSERIAL_8E1,
122+
SWSERIAL_5O1 = PARITY_ODD,
123+
SWSERIAL_6O1,
124+
SWSERIAL_7O1,
125+
SWSERIAL_8O1,
126+
SWSERIAL_5M1 = PARITY_MARK,
127+
SWSERIAL_6M1,
128+
SWSERIAL_7M1,
129+
SWSERIAL_8M1,
130+
SWSERIAL_5S1 = PARITY_SPACE,
131+
SWSERIAL_6S1,
132+
SWSERIAL_7S1,
133+
SWSERIAL_8S1,
134+
SWSERIAL_5N2 = 0200 | PARITY_NONE,
135+
SWSERIAL_6N2,
136+
SWSERIAL_7N2,
137+
SWSERIAL_8N2,
138+
SWSERIAL_5E2 = 0200 | PARITY_EVEN,
139+
SWSERIAL_6E2,
140+
SWSERIAL_7E2,
141+
SWSERIAL_8E2,
142+
SWSERIAL_5O2 = 0200 | PARITY_ODD,
143+
SWSERIAL_6O2,
144+
SWSERIAL_7O2,
145+
SWSERIAL_8O2,
146+
SWSERIAL_5M2 = 0200 | PARITY_MARK,
147+
SWSERIAL_6M2,
148+
SWSERIAL_7M2,
149+
SWSERIAL_8M2,
150+
SWSERIAL_5S2 = 0200 | PARITY_SPACE,
151+
SWSERIAL_6S2,
152+
SWSERIAL_7S2,
153+
SWSERIAL_8S2,
154154
};
155155

156156
/// This class is compatible with the corresponding AVR one, however,
@@ -416,7 +416,7 @@ template< class GpioCapabilities > class BasicUART : public UARTBase {
416416
int8_t rxPin) {
417417
begin(baud, config, rxPin, m_txPin, m_invert);
418418
}
419-
void begin(uint32_t baud, Config config = SERIAL_8N1) {
419+
void begin(uint32_t baud, Config config = SWSERIAL_8N1) {
420420
begin(baud, config, m_rxPin, m_txPin, m_invert);
421421
}
422422
void setTransmitEnablePin(int8_t txEnablePin) {
@@ -430,6 +430,7 @@ using UART = BasicUART< GpioCapabilities >;
430430
}; // namespace EspSoftwareSerial
431431

432432
using SoftwareSerial = EspSoftwareSerial::UART;
433+
using namespace EspSoftwareSerial;
433434

434435
// The template member functions below must be in IRAM, but due to a bug GCC doesn't currently
435436
// honor the attribute. Instead, it is possible to do explicit specialization and adorn

0 commit comments

Comments
 (0)