Skip to content

Commit

Permalink
✨ SD Endstop Abort G-Code (MarlinFirmware#24461)
Browse files Browse the repository at this point in the history
  • Loading branch information
ExtNeon authored and Andy-Big committed Jun 30, 2023
1 parent e77f624 commit 0a0e0bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,9 @@
* Endstops must be activated for this option to work.
*/
//#define SD_ABORT_ON_ENDSTOP_HIT
#if ENABLED(SD_ABORT_ON_ENDSTOP_HIT)
//#define SD_ABORT_ON_ENDSTOP_HIT_GCODE "G28XY" // G-code to run on endstop hit (e.g., "G28XY" or "G27")
#endif

//#define SD_REPRINT_LAST_SELECTED_FILE // On print completion open the LCD Menu and select the same file

Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/module/endstops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ void Endstops::event_handler() {
card.abortFilePrintNow();
quickstop_stepper();
thermalManager.disable_all_heaters();
#ifdef SD_ABORT_ON_ENDSTOP_HIT_GCODE
queue.clear();
queue.inject(F(SD_ABORT_ON_ENDSTOP_HIT_GCODE));
#endif
print_job_timer.stop();
}
#endif
Expand Down

0 comments on commit 0a0e0bb

Please sign in to comment.