Improve menu pause / resume (#12876)
This commit is contained in:
committed by
Scott Lahteine
parent
432c21456f
commit
a403d9a50c
@ -85,18 +85,26 @@ void GcodeSuite::M23() {
|
||||
* M24: Start or Resume SD Print
|
||||
*/
|
||||
void GcodeSuite::M24() {
|
||||
#if ENABLED(PARK_HEAD_ON_PAUSE)
|
||||
resume_print();
|
||||
#endif
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
if (parser.seenval('S')) card.setIndex(parser.value_long());
|
||||
if (parser.seenval('T')) print_job_timer.resume(parser.value_long());
|
||||
#endif
|
||||
|
||||
card.startFileprint();
|
||||
print_job_timer.start();
|
||||
ui.reset_status();
|
||||
#if ENABLED(PARK_HEAD_ON_PAUSE)
|
||||
resume_print();
|
||||
#else
|
||||
if (card.isFileOpen()) {
|
||||
card.startFileprint();
|
||||
print_job_timer.start();
|
||||
}
|
||||
|
||||
ui.reset_status();
|
||||
|
||||
#ifdef ACTION_ON_RESUME
|
||||
SERIAL_ECHOLNPGM("//action:" ACTION_ON_RESUME);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,9 +114,16 @@ void GcodeSuite::M25() {
|
||||
#if ENABLED(PARK_HEAD_ON_PAUSE)
|
||||
M125();
|
||||
#else
|
||||
card.pauseSDPrint();
|
||||
#if ENABLED(SDSUPPORT)
|
||||
if (IS_SD_PRINTING()) card.pauseSDPrint();
|
||||
#endif
|
||||
|
||||
print_job_timer.pause();
|
||||
ui.reset_status();
|
||||
|
||||
#ifdef ACTION_ON_PAUSE
|
||||
SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -116,7 +131,7 @@ void GcodeSuite::M25() {
|
||||
* M26: Set SD Card file index
|
||||
*/
|
||||
void GcodeSuite::M26() {
|
||||
if (card.flag.cardOK && parser.seenval('S'))
|
||||
if (card.isDetected() && parser.seenval('S'))
|
||||
card.setIndex(parser.value_long());
|
||||
}
|
||||
|
||||
@ -207,7 +222,7 @@ void GcodeSuite::M29() {
|
||||
* M30 <filename>: Delete SD Card file
|
||||
*/
|
||||
void GcodeSuite::M30() {
|
||||
if (card.flag.cardOK) {
|
||||
if (card.isDetected()) {
|
||||
card.closefile();
|
||||
card.removeFile(parser.string_arg);
|
||||
}
|
||||
@ -226,7 +241,7 @@ void GcodeSuite::M30() {
|
||||
void GcodeSuite::M32() {
|
||||
if (IS_SD_PRINTING()) planner.synchronize();
|
||||
|
||||
if (card.flag.cardOK) {
|
||||
if (card.isDetected()) {
|
||||
const bool call_procedure = parser.boolval('P');
|
||||
|
||||
card.openFile(parser.string_arg, true, call_procedure);
|
||||
|
Reference in New Issue
Block a user