From b2cb42c40a4b6ab4d4d7f95df7002d688a658f47 Mon Sep 17 00:00:00 2001 From: Kajetan Rzepecki Date: Mon, 30 Dec 2024 19:44:40 +0100 Subject: [PATCH] Fix LoadProhibited when using SoftwareSerial in a funky way. --- lib/ZE25-O3/ZE25.cpp | 6 +++--- lib/ZE27-O3/ZE27.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ZE25-O3/ZE25.cpp b/lib/ZE25-O3/ZE25.cpp index 57564d9..836ccf3 100644 --- a/lib/ZE25-O3/ZE25.cpp +++ b/lib/ZE25-O3/ZE25.cpp @@ -41,11 +41,11 @@ uint8_t ZE25::calculateChecksum(uint8_t msg[kMessageLength]){ return checksum; } -ZE25::ZE25(HardwareSerial& device) : hw_stream_ (&device) { +ZE25::ZE25(HardwareSerial& device) : hw_stream_ (&device), sw_stream_(nullptr) { setStream(); } -ZE25::ZE25(SoftwareSerial& device) : sw_stream_(&device) { +ZE25::ZE25(SoftwareSerial& device) : sw_stream_(&device), hw_stream_(nullptr) { setStream(); } @@ -154,4 +154,4 @@ float ZE25::getPPM() { } else { return getActiveData(); } -} \ No newline at end of file +} diff --git a/lib/ZE27-O3/ZE27.cpp b/lib/ZE27-O3/ZE27.cpp index 992d7ed..e004472 100644 --- a/lib/ZE27-O3/ZE27.cpp +++ b/lib/ZE27-O3/ZE27.cpp @@ -41,11 +41,11 @@ uint8_t ZE27::calculateChecksum(uint8_t msg[kMessageLength]){ return checksum; } -ZE27::ZE27(HardwareSerial& device) : hw_stream_ (&device) { +ZE27::ZE27(HardwareSerial& device) : hw_stream_ (&device), sw_stream_(nullptr) { setStream(); } -ZE27::ZE27(SoftwareSerial& device) : sw_stream_(&device) { +ZE27::ZE27(SoftwareSerial& device) : sw_stream_(&device), hw_stream_(nullptr) { setStream(); } @@ -154,4 +154,4 @@ float ZE27::getPPM() { } else { return getActiveData(); } -} \ No newline at end of file +}