From 9a08f2df6330043445d5045b0f703fbc9030619b Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Thu, 29 Aug 2024 13:41:37 +0200 Subject: [PATCH] ESP32: Make Serial2 possible for commands --- SerialManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SerialManager.cpp b/SerialManager.cpp index 88bc7cd..8430089 100644 --- a/SerialManager.cpp +++ b/SerialManager.cpp @@ -68,7 +68,11 @@ void SerialManager::init() { new SerialManager(&Serial3); #endif #ifdef SERIAL2_COMMANDS +#ifdef ARDUINO_ARCH_ESP32 + Serial2.begin(115200, SERIAL_8N1, 16, 17); // GPIO 16 RXD2; GPIO 17 TXD2 on ESP32 +#else // not ESP32 Serial2.begin(115200); +#endif // ESP32 new SerialManager(&Serial2); #endif #ifdef SERIAL1_COMMANDS @@ -88,8 +92,10 @@ void SerialManager::init() { } #endif #ifdef SABERTOOTH +#ifdef ARDUINO_ARCH_ESP32 Serial2.begin(9600, SERIAL_8N1, 16, 17); // GPIO 16 RXD2; GPIO 17 TXD2 on ESP32 #endif +#endif } void SerialManager::broadcast(char * stringBuffer) {