diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 19d799534..46fef27a0 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -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() diff --git a/Firmware/planner.cpp b/Firmware/planner.cpp index 752d07258..63058d2cf 100644 --- a/Firmware/planner.cpp +++ b/Firmware/planner.cpp @@ -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! diff --git a/Firmware/planner.h b/Firmware/planner.h index 7904c45a5..4977265bf 100644 --- a/Firmware/planner.h +++ b/Firmware/planner.h @@ -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);