Add HAS_RESUME_CONTINUE shorthand macro

This commit is contained in:
Scott Lahteine 2017-04-09 11:12:08 -05:00
parent 53e6c33c37
commit 36bda2bade
3 changed files with 7 additions and 6 deletions

View file

@ -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

View file

@ -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

View file

@ -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();