From 3969d1b333939d5af1f7bc261fcdcb9f7b3165ca Mon Sep 17 00:00:00 2001 From: Ben Agricola Date: Wed, 2 Oct 2024 10:52:46 +0100 Subject: [PATCH] Suppress M261.1 modbus errors writing to var Signed-off-by: Ben Agricola --- src/Platform/Platform.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Platform/Platform.cpp b/src/Platform/Platform.cpp index 034896bc1c..1a0276974e 100644 --- a/src/Platform/Platform.cpp +++ b/src/Platform/Platform.cpp @@ -2709,12 +2709,12 @@ GCodeResult Platform::ReceiveI2cOrModbus(GCodeBuffer& gb, const StringRef &reply break; } } - else + else if (resultVar == nullptr) // Only report comm error if not storing result in variable { reply.copy("no or bad response from Modbus device"); } } - else + else if (resultVar == nullptr) { reply.copy("couldn't initiate Modbus transaction"); }