3333#ifdef ESP32
3434constexpr int IUTBITRATE = 57600 ;
3535#else
36- constexpr int IUTBITRATE = 153600 ;
36+ constexpr int IUTBITRATE = 74880 ;
3737#endif
3838
3939#if defined(ESP8266)
@@ -45,6 +45,7 @@ constexpr uint32_t hwSerialConfig = SERIAL_8E1;
4545#else
4646constexpr unsigned swSerialConfig = 3 ;
4747#endif
48+ constexpr bool invert = false ;
4849
4950constexpr int BLOCKSIZE = 16 ; // use fractions of 256
5051
@@ -88,7 +89,7 @@ HardwareSerial& logger(Serial);
8889void setup () {
8990#if defined(ESP8266)
9091#if defined(HWLOOPBACK) || defined(HWSOURCESINK) || defined(HWSOURCESWSINK)
91- Serial.begin (IUTBITRATE, hwSerialConfig);
92+ Serial.begin (IUTBITRATE, hwSerialConfig, SERIAL_FULL, 1 , invert );
9293 Serial.swap ();
9394 Serial.setRxBufferSize (2 * BLOCKSIZE);
9495 logger.begin (9600 , SWSERIAL_8N1, -1 , TX);
@@ -97,11 +98,11 @@ void setup() {
9798#endif
9899#elif defined(ESP32)
99100#if defined(HWLOOPBACK) || defined(HWSOURCESWSINK)
100- Serial2.begin (IUTBITRATE, hwSerialConfig, D4, D3, false );
101+ Serial2.begin (IUTBITRATE, hwSerialConfig, D4, D3, invert );
101102 Serial2.setRxBufferSize (2 * BLOCKSIZE);
102103 logger.begin (9600 );
103104#elif defined(HWSOURCESINK)
104- serialIUT.begin (IUTBITRATE, hwSerialConfig, D5, D6);
105+ serialIUT.begin (IUTBITRATE, hwSerialConfig, D5, D6, invert );
105106 serialIUT.setRxBufferSize (2 * BLOCKSIZE);
106107 logger.begin (9600 );
107108#else
@@ -113,12 +114,12 @@ void setup() {
113114
114115#if !defined(HWSOURCESINK)
115116#if defined(ESP8266)
116- serialIUT.begin (IUTBITRATE, swSerialConfig, D5, D6, false , 4 * BLOCKSIZE);
117+ serialIUT.begin (IUTBITRATE, swSerialConfig, D5, D6, invert , 4 * BLOCKSIZE);
117118#ifdef HALFDUPLEX
118119 serialIUT.enableIntTx (false );
119120#endif
120121#elif defined(ESP32)
121- serialIUT.begin (IUTBITRATE, swSerialConfig, D5, D6, false , 2 * BLOCKSIZE);
122+ serialIUT.begin (IUTBITRATE, swSerialConfig, D5, D6, invert , 2 * BLOCKSIZE);
122123#ifdef HALFDUPLEX
123124 serialIUT.enableIntTx (false );
124125#endif
0 commit comments