From 610bbdd4662c3516acff0430ea8ac0b668dcae41 Mon Sep 17 00:00:00 2001 From: Leif Date: Mon, 26 Sep 2022 18:33:32 +0700 Subject: [PATCH 1/2] contents of legacy begin() function now inside an #if !defined(NO_GLOBAL_SERIAL) block --- src/PacketSerial.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PacketSerial.h b/src/PacketSerial.h index 67de570..79aa68b 100644 --- a/src/PacketSerial.h +++ b/src/PacketSerial.h @@ -84,11 +84,13 @@ class PacketSerial_ /// \sa https://www.arduino.cc/en/Serial/Begin void begin(unsigned long speed) { + #if !defined(NO_GLOBAL_SERIAL) Serial.begin(speed); #if ARDUINO >= 100 && !defined(CORE_TEENSY) while (!Serial) {;} #endif setStream(&Serial); + #endif } /// \brief Deprecated. Use setStream() to configure a non-default port. From 08d2783b26f48bb4ad2d975178782d9678467ff7 Mon Sep 17 00:00:00 2001 From: Leif Date: Mon, 26 Sep 2022 18:37:16 +0700 Subject: [PATCH 2/2] contents of legacy begin() function now inside an #if !defined(NO_GLOBAL_SERIAL) block, indented with spaces. --- src/PacketSerial.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PacketSerial.h b/src/PacketSerial.h index 79aa68b..02daca5 100644 --- a/src/PacketSerial.h +++ b/src/PacketSerial.h @@ -84,13 +84,13 @@ class PacketSerial_ /// \sa https://www.arduino.cc/en/Serial/Begin void begin(unsigned long speed) { - #if !defined(NO_GLOBAL_SERIAL) + #if !defined(NO_GLOBAL_SERIAL) Serial.begin(speed); #if ARDUINO >= 100 && !defined(CORE_TEENSY) while (!Serial) {;} #endif setStream(&Serial); - #endif + #endif } /// \brief Deprecated. Use setStream() to configure a non-default port.