if(argument == nullptr && this->playing_file ) {
abort_command("1", &(StreamOutput::NullStream));
}
-
+
if(argument == nullptr && this->suspended) {
// clean up from suspend
this->suspended= false;
this->saved_temperatures.clear();
this->was_playing_file= false;
this->suspend_loops= 0;
+ THEKERNEL->streams->printf("// Suspend cleared\n");
}
}
// wait for queue to empty
THEKERNEL->conveyor->wait_for_idle();
+ if(THEKERNEL->is_halted()) {
+ THEKERNEL->streams->printf("Suspend aborted by kill\n");
+ suspended= false;
+ return;
+ }
+
THEKERNEL->streams->printf("// Saving current state...\n");
// save current XYZ position
}
}
+ // clean up
+ this->saved_temperatures.clear();
+
+ if(THEKERNEL->is_halted()) {
+ THEKERNEL->streams->printf("Resume aborted by kill\n");
+ THEROBOT->pop_state();
+ suspended= false;
+ return;
+ }
+
// execute optional gcode if defined
if(!before_resume_gcode.empty()) {
stream->printf("Executing before resume gcode...\n");
// restore extruder state
PublicData::set_value( extruder_checksum, restore_state_checksum, nullptr );
+ if(THEKERNEL->is_halted()) {
+ THEKERNEL->streams->printf("Resume aborted by kill\n");
+ suspended= false;
+ return;
+ }
+
stream->printf("Resuming print\n");
if(this->was_playing_file) {
THEKERNEL->streams->printf("// action:resume\r\n");
}
- // clean up
- this->saved_temperatures.clear();
- suspended= false;
+ suspended= false;
}