Browse Source

✨ SD Endstop Abort G-Code (#24461)

ExtNeon 1 year ago
parent
commit
53b202cf9d
No account linked to committer's email address
2 changed files with 7 additions and 0 deletions
  1. 3
    0
      Marlin/Configuration_adv.h
  2. 4
    0
      Marlin/src/module/endstops.cpp

+ 3
- 0
Marlin/Configuration_adv.h View File

@@ -1589,6 +1589,9 @@
1589 1589
    * Endstops must be activated for this option to work.
1590 1590
    */
1591 1591
   //#define SD_ABORT_ON_ENDSTOP_HIT
1592
+  #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT)
1593
+    //#define SD_ABORT_ON_ENDSTOP_HIT_GCODE "G28XY" // G-code to run on endstop hit (e.g., "G28XY" or "G27")
1594
+  #endif
1592 1595
 
1593 1596
   //#define SD_REPRINT_LAST_SELECTED_FILE // On print completion open the LCD Menu and select the same file
1594 1597
 

+ 4
- 0
Marlin/src/module/endstops.cpp View File

@@ -551,6 +551,10 @@ void Endstops::event_handler() {
551 551
         card.abortFilePrintNow();
552 552
         quickstop_stepper();
553 553
         thermalManager.disable_all_heaters();
554
+        #ifdef SD_ABORT_ON_ENDSTOP_HIT_GCODE
555
+          queue.clear();
556
+          queue.inject(F(SD_ABORT_ON_ENDSTOP_HIT_GCODE));
557
+        #endif
554 558
         print_job_timer.stop();
555 559
       }
556 560
     #endif

Loading…
Cancel
Save