From c7ed706f43e7229bec2f243680bfb2954935b5c9 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Fri, 26 Oct 2018 03:52:37 -0500
Subject: [PATCH] Fix endstops.monitor_flag

---
 Marlin/Marlin_main.cpp | 4 ++--
 Marlin/pinsDebug.h     | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
index fdec77414b..88ab61d861 100644
--- a/Marlin/Marlin_main.cpp
+++ b/Marlin/Marlin_main.cpp
@@ -7875,9 +7875,9 @@ inline void gcode_M42() {
 
     // Enable or disable endstop monitoring
     if (parser.seen('E')) {
-      endstop_monitor_flag = parser.value_bool();
+      endstops.monitor_flag = parser.value_bool();
       SERIAL_PROTOCOLPGM("endstop monitor ");
-      serialprintPGM(endstop_monitor_flag ? PSTR("en") : PSTR("dis"));
+      serialprintPGM(endstops.monitor_flag ? PSTR("en") : PSTR("dis"));
       SERIAL_PROTOCOLLNPGM("abled");
       return;
     }
diff --git a/Marlin/pinsDebug.h b/Marlin/pinsDebug.h
index 24d058b4f2..ba6241fbeb 100644
--- a/Marlin/pinsDebug.h
+++ b/Marlin/pinsDebug.h
@@ -20,8 +20,6 @@
  *
  */
 
-bool endstop_monitor_flag = false;
-
 #define NAME_FORMAT "%-35s"   // one place to specify the format of all the sources of names
                                // "-" left justify, "28" minimum width of name, pad with blanks