Unroll the stack in restore_print_from_ram_and_continue

While handling moves in a recursive plan, such a filament check,
ensure restore_print_from_ram_and_continue unwinds the stack by
aborting early from any call that waits on the planner.

This currently only handles G1 moves, but hard-coded behavior that can
trigger recursive behavior (such as filament change) will probably have
to be checked too.
This commit is contained in:
Yuri D'Elia 2019-10-15 21:09:28 +02:00
parent 404802b5e6
commit 0f6b9b4051
3 changed files with 8 additions and 1 deletions

View File

@ -8363,6 +8363,8 @@ void clamp_to_software_endstops(float target[3])
current_position[Z_AXIS] + t * dz,
current_position[E_AXIS] + t * de,
feed_rate, extruder);
if (waiting_inside_plan_buffer_line_print_aborted)
return;
}
}
// The rest of the path.
@ -8390,6 +8392,8 @@ void prepare_move()
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply*(1./(60.f*100.f)), active_extruder);
#endif
}
if (waiting_inside_plan_buffer_line_print_aborted)
return;
for(int8_t i=0; i < NUM_AXIS; i++) {
current_position[i] = destination[i];
@ -10264,10 +10268,12 @@ void restore_print_from_ram_and_continue(float e_move)
else {
//not sd printing nor usb printing
}
SERIAL_PROTOCOLLNRPGM(MSG_OK); //dummy response because of octoprint is waiting for this
lcd_setstatuspgm(_T(WELCOME_MSG));
saved_printing_type = PRINTING_TYPE_NONE;
saved_printing = false;
waiting_inside_plan_buffer_line_print_aborted = true; //unroll the stack
}
void print_world_coordinates()

View File

@ -666,8 +666,8 @@ void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate
// If the buffer is full: good! That means we are well ahead of the robot.
// Rest here until there is room in the buffer.
waiting_inside_plan_buffer_line_print_aborted = false;
if (block_buffer_tail == next_buffer_head) {
waiting_inside_plan_buffer_line_print_aborted = false;
do {
manage_heater();
// Vojtech: Don't disable motors inside the planner!

View File

@ -238,6 +238,7 @@ FORCE_INLINE bool planner_queue_full() {
// wait for the steppers to stop,
// update planner's current position and the current_position of the front end.
extern void planner_abort_hard();
extern bool waiting_inside_plan_buffer_line_print_aborted;
#ifdef PREVENT_DANGEROUS_EXTRUDE
void set_extrude_min_temp(float temp);