From dc1113165601db4675036f52267f8489464107a1 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Tue, 25 Sep 2018 19:56:57 +0200 Subject: [PATCH] [2.0.x] fix possible race condition (#11923) Fix some commits done in #11900 --- Marlin/src/module/endstops.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index fb7a36ecb..a7e2a57d6 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -279,12 +279,11 @@ void Endstops::not_homing() { // Otherwise reset 'live's variables to let axes move in both directions. if (!enabled) { #if ENDSTOP_NOISE_THRESHOLD - endstop_poll_count = validated_live_state = 0; // Stop filtering + endstop_poll_count = 0; // Stop filtering (MUST be done first to prevent race condition) + validated_live_state = 0; #endif live_state = 0; } - //#else - // When in polling endstops are always kept in sync #endif }