Add M524 to abort SD printing (#12155)

This commit is contained in:
TheSFReader
2018-10-19 21:25:07 +02:00
committed by Scott Lahteine
parent d26d9d5b81
commit 1fb9b299d4
9 changed files with 23 additions and 21 deletions

View File

@ -584,6 +584,10 @@ void GcodeSuite::process_parsed_command(
case 504: M504(); break; // M504: Validate EEPROM contents
#endif
#if ENABLED(SDSUPPORT)
case 524: M524(); break; // M524: Abort the current SD print job
#endif
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
case 540: M540(); break; // M540: Set abort on endstop hit for SD printing
#endif

View File

@ -202,6 +202,7 @@
* M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS)
* M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! **
* M503 - Print the current settings (in memory): "M503 S<verbose>". S0 specifies compact output.
* M524 - Abort the current SD print job (started with M24)
* M540 - Enable/disable SD card abort on endstop hit: "M540 S<state>". (Requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
* M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
* M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
@ -719,6 +720,10 @@ private:
static void M504();
#endif
#if ENABLED(SDSUPPORT)
static void M524();
#endif
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
static void M540();
#endif

View File

@ -244,6 +244,13 @@ void GcodeSuite::M32() {
#endif // SDCARD_SORT_ALPHA && SDSORT_GCODE
/**
* M524: Abort the current SD print job (started with M24)
*/
void GcodeSuite::M524() {
if (IS_SD_PRINTING()) card.abort_sd_printing = true;
}
/**
* M928: Start SD Write
*/