Browse Source

Add HAS_RESUME_CONTINUE shorthand macro

Scott Lahteine 8 years ago
parent
commit
36bda2bade
3 changed files with 7 additions and 6 deletions
  1. 1
    0
      Marlin/Conditionals_LCD.h
  2. 1
    1
      Marlin/Marlin.h
  3. 5
    5
      Marlin/Marlin_main.cpp

+ 1
- 0
Marlin/Conditionals_LCD.h View File

@@ -385,5 +385,6 @@
385 385
   #endif
386 386
 
387 387
   #define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS))
388
+  #define HAS_RESUME_CONTINUE (ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER))
388 389
 
389 390
 #endif //CONDITIONALS_LCD_H

+ 1
- 1
Marlin/Marlin.h View File

@@ -221,7 +221,7 @@ extern bool axis_known_position[XYZ]; // axis[n].is_known
221 221
 extern bool axis_homed[XYZ]; // axis[n].is_homed
222 222
 extern volatile bool wait_for_heatup;
223 223
 
224
-#if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL)
224
+#if HAS_RESUME_CONTINUE
225 225
   extern volatile bool wait_for_user;
226 226
 #endif
227 227
 

+ 5
- 5
Marlin/Marlin_main.cpp View File

@@ -443,7 +443,7 @@ static bool relative_mode = false;
443 443
 volatile bool wait_for_heatup = true;
444 444
 
445 445
 // For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop
446
-#if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL)
446
+#if HAS_RESUME_CONTINUE
447 447
   volatile bool wait_for_user = false;
448 448
 #endif
449 449
 
@@ -4967,7 +4967,7 @@ inline void gcode_G92() {
4967 4967
   report_current_position();
4968 4968
 }
4969 4969
 
4970
-#if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL)
4970
+#if HAS_RESUME_CONTINUE
4971 4971
 
4972 4972
   /**
4973 4973
    * M0: Unconditional stop - Wait for user button press on LCD
@@ -5504,7 +5504,7 @@ inline void gcode_M42() {
5504 5504
           pin_state[pin - first_pin] = digitalRead(pin);
5505 5505
       }
5506 5506
 
5507
-      #if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL)
5507
+      #if HAS_RESUME_CONTINUE
5508 5508
         wait_for_user = true;
5509 5509
       #endif
5510 5510
 
@@ -5522,7 +5522,7 @@ inline void gcode_M42() {
5522 5522
           }
5523 5523
         }
5524 5524
 
5525
-        #if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL)
5525
+        #if HAS_RESUME_CONTINUE
5526 5526
           if (!wait_for_user) break;
5527 5527
         #endif
5528 5528
 
@@ -9139,7 +9139,7 @@ void process_next_command() {
9139 9139
     break;
9140 9140
 
9141 9141
     case 'M': switch (codenum) {
9142
-      #if ENABLED(ULTIPANEL) || ENABLED(EMERGENCY_PARSER)
9142
+      #if HAS_RESUME_CONTINUE
9143 9143
         case 0: // M0: Unconditional stop - Wait for user button press on LCD
9144 9144
         case 1: // M1: Conditional stop - Wait for user button press on LCD
9145 9145
           gcode_M0_M1();

Loading…
Cancel
Save