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
   #endif
385
   #endif
386
 
386
 
387
   #define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS))
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
 #endif //CONDITIONALS_LCD_H
390
 #endif //CONDITIONALS_LCD_H

+ 1
- 1
Marlin/Marlin.h View File

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

+ 5
- 5
Marlin/Marlin_main.cpp View File

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

Loading…
Cancel
Save