From 135b06e574c5eb4d86584df735621a33e21deb3b Mon Sep 17 00:00:00 2001 From: mycprotein Date: Tue, 7 Jan 2025 20:40:20 +0800 Subject: [PATCH] Update ZgatewaySERIAL.ino to conditionally set receiverReady based on heartbeat configuration --- main/ZgatewaySERIAL.ino | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main/ZgatewaySERIAL.ino b/main/ZgatewaySERIAL.ino index fec15511eb..46407c6856 100644 --- a/main/ZgatewaySERIAL.ino +++ b/main/ZgatewaySERIAL.ino @@ -48,12 +48,17 @@ const TickType_t semaphoreTimeout = pdMS_TO_TICKS(1000); // 1 second timeout # define SEMAPHORE_SERIAL_GIVE # endif +# ifdef SENDER_SERIAL_HEARTBEAT + bool receiverReady = false; +# else + bool receiverReady = true; +# endif + // use pointer to stream class for serial communication to make code // compatible with both softwareSerial as hardwareSerial. Stream* SERIALStream = NULL; //unsigned long msgCount = 0; -bool receiverReady = true; unsigned long lastHeartbeatReceived = 0; unsigned long lastHeartbeatAckReceived = 0; unsigned long lastHeartbeatSent = 0;