Browse Source

Fix crashes when the Z axis is moved via LCD

Fix crashes when the Z axis is moved via LCD
by calling `plan_buffer_line` only when there is enough room in the
planner buffer, to avoid endless recursion.
A brief description about what went wrong is in #1166
Blue-Marlin 9 years ago
parent
commit
fd9e94e5a4
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      Marlin/ultralcd.cpp

+ 6
- 2
Marlin/ultralcd.cpp View File

830
     if (min_software_endstops && current_position[axis] < min) current_position[axis] = min;
830
     if (min_software_endstops && current_position[axis] < min) current_position[axis] = min;
831
     if (max_software_endstops && current_position[axis] > max) current_position[axis] = max;
831
     if (max_software_endstops && current_position[axis] > max) current_position[axis] = max;
832
     encoderPosition = 0;
832
     encoderPosition = 0;
833
-    line_to_current(axis);
833
+    if (movesplanned() <= 3)
834
+      line_to_current(axis);
834
     lcdDrawUpdate = 1;
835
     lcdDrawUpdate = 1;
835
   }
836
   }
836
   if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis]));
837
   if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis]));
837
-  if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis);
838
+  if (LCD_CLICKED) {
839
+      line_to_current(axis);
840
+      lcd_goto_menu(lcd_move_menu_axis);
841
+  }
838
 }
842
 }
839
 static void lcd_move_x() { _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, X_MIN_POS, X_MAX_POS); }
843
 static void lcd_move_x() { _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, X_MIN_POS, X_MAX_POS); }
840
 static void lcd_move_y() { _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, Y_MIN_POS, Y_MAX_POS); }
844
 static void lcd_move_y() { _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, Y_MIN_POS, Y_MAX_POS); }

Loading…
Cancel
Save