From 36bda2badea82afe94e852c9f9f4ba2ede22aa4d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 9 Apr 2017 11:12:08 -0500 Subject: [PATCH] Add HAS_RESUME_CONTINUE shorthand macro --- Marlin/Conditionals_LCD.h | 1 + Marlin/Marlin.h | 2 +- Marlin/Marlin_main.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h index 511cb019ea..4b23ea3e9d 100644 --- a/Marlin/Conditionals_LCD.h +++ b/Marlin/Conditionals_LCD.h @@ -385,5 +385,6 @@ #endif #define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS)) + #define HAS_RESUME_CONTINUE (ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER)) #endif //CONDITIONALS_LCD_H diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 122a3547a4..159745b7f3 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -221,7 +221,7 @@ extern bool axis_known_position[XYZ]; // axis[n].is_known extern bool axis_homed[XYZ]; // axis[n].is_homed extern volatile bool wait_for_heatup; -#if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL) +#if HAS_RESUME_CONTINUE extern volatile bool wait_for_user; #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 17f461f871..86f5e3b3c7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -443,7 +443,7 @@ static bool relative_mode = false; volatile bool wait_for_heatup = true; // For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop -#if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL) +#if HAS_RESUME_CONTINUE volatile bool wait_for_user = false; #endif @@ -4967,7 +4967,7 @@ inline void gcode_G92() { report_current_position(); } -#if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL) +#if HAS_RESUME_CONTINUE /** * M0: Unconditional stop - Wait for user button press on LCD @@ -5504,7 +5504,7 @@ inline void gcode_M42() { pin_state[pin - first_pin] = digitalRead(pin); } - #if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL) + #if HAS_RESUME_CONTINUE wait_for_user = true; #endif @@ -5522,7 +5522,7 @@ inline void gcode_M42() { } } - #if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL) + #if HAS_RESUME_CONTINUE if (!wait_for_user) break; #endif @@ -9139,7 +9139,7 @@ void process_next_command() { break; case 'M': switch (codenum) { - #if ENABLED(ULTIPANEL) || ENABLED(EMERGENCY_PARSER) + #if HAS_RESUME_CONTINUE case 0: // M0: Unconditional stop - Wait for user button press on LCD case 1: // M1: Conditional stop - Wait for user button press on LCD gcode_M0_M1();