From c5713b5e981e0dc3646a10082cc061afd8e7406f Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Tue, 29 Oct 2019 15:58:00 -0500
Subject: [PATCH] Clean Endstops::event_handler

---
 Marlin/src/module/endstops.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp
index 24c357e2b7b..a5235ea0582 100644
--- a/Marlin/src/module/endstops.cpp
+++ b/Marlin/src/module/endstops.cpp
@@ -340,7 +340,9 @@ void Endstops::resync() {
 
 void Endstops::event_handler() {
   static uint8_t prev_hit_state; // = 0
-  if (hit_state && hit_state != prev_hit_state) {
+  if (hit_state == prev_hit_state) return;
+  prev_hit_state = hit_state;
+  if (hit_state) {
     #if HAS_SPI_LCD
       char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' ';
       #define _SET_STOP_CHAR(A,C) (chr## A = C)
@@ -385,7 +387,6 @@ void Endstops::event_handler() {
       }
     #endif
   }
-  prev_hit_state = hit_state;
 }
 
 static void print_es_state(const bool is_hit, PGM_P const label=nullptr) {