From 2ee4e4f79120e5f530a70650704cdec94b6b0376 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <sourcetree@thinkyhead.com>
Date: Wed, 6 Jul 2016 19:59:19 -0700
Subject: [PATCH] Make wait_for_heatup volatile

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

diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h
index 2159fb0192..5c698834b7 100644
--- a/Marlin/Marlin.h
+++ b/Marlin/Marlin.h
@@ -286,7 +286,7 @@ extern float sw_endstop_min[3]; // axis[n].sw_endstop_min
 extern float sw_endstop_max[3]; // axis[n].sw_endstop_max
 extern bool axis_known_position[3]; // axis[n].is_known
 extern bool axis_homed[3]; // axis[n].is_homed
-extern bool wait_for_heatup;
+extern volatile bool wait_for_heatup;
 
 // GCode support for external objects
 bool code_seen(char);
diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
index 3d8ba84432..fffff449bc 100644
--- a/Marlin/Marlin_main.cpp
+++ b/Marlin/Marlin_main.cpp
@@ -332,7 +332,7 @@ uint8_t active_extruder = 0;
 // Relative Mode. Enable with G91, disable with G90.
 static bool relative_mode = false;
 
-bool wait_for_heatup = true;
+volatile bool wait_for_heatup = true;
 
 const char errormagic[] PROGMEM = "Error:";
 const char echomagic[] PROGMEM = "echo:";
diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h
index cc0a10fd3b..40b09606ae 100644
--- a/Marlin/ultralcd.h
+++ b/Marlin/ultralcd.h
@@ -95,8 +95,6 @@
   extern int absPreheatHPBTemp;
   extern int absPreheatFanSpeed;
 
-  extern bool wait_for_heatup;
-
   #if ENABLED(FILAMENT_LCD_DISPLAY)
     extern millis_t previous_lcd_status_ms;
   #endif
-- 
GitLab