瀏覽代碼

Merge pull request #3126 from Blue-Marlin/stackoverflow-with-e

Extend stack_overflow_protection for lcd_move_e and _lcd_level_bed
Scott Lahteine 8 年之前
父節點
當前提交
21be07a6f6
共有 1 個檔案被更改,包括 5 行新增9 行删除
  1. 5
    9
      Marlin/ultralcd.cpp

+ 5
- 9
Marlin/ultralcd.cpp 查看文件

@@ -828,21 +828,17 @@ float move_menu_scale;
828 828
 static void lcd_move_menu_axis();
829 829
 
830 830
 static void _lcd_move(const char* name, AxisEnum axis, int min, int max) {
831
-  if (encoderPosition != 0) {
831
+  if ((encoderPosition != 0) && (movesplanned() <= 3)) {
832 832
     refresh_cmd_timeout();
833 833
     current_position[axis] += float((int)encoderPosition) * move_menu_scale;
834 834
     if (min_software_endstops) NOLESS(current_position[axis], min);
835 835
     if (max_software_endstops) NOMORE(current_position[axis], max);
836 836
     encoderPosition = 0;
837
-    if (movesplanned() <= 3)
838
-      line_to_current(axis);
837
+    line_to_current(axis);
839 838
     lcdDrawUpdate = 1;
840 839
   }
841 840
   if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis]));
842
-  if (LCD_CLICKED) {
843
-      line_to_current(axis);
844
-      lcd_goto_previous_menu();
845
-  }
841
+  if (LCD_CLICKED) lcd_goto_previous_menu();
846 842
 }
847 843
 #if ENABLED(DELTA)
848 844
   static float delta_clip_radius_2 =  DELTA_PRINTABLE_RADIUS * DELTA_PRINTABLE_RADIUS;
@@ -863,7 +859,7 @@ static void lcd_move_e(
863 859
     unsigned short original_active_extruder = active_extruder;
864 860
     active_extruder = e;
865 861
   #endif
866
-  if (encoderPosition != 0) {
862
+  if ((encoderPosition != 0) && (movesplanned() <= 3)) {
867 863
     current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
868 864
     encoderPosition = 0;
869 865
     line_to_current(E_AXIS);
@@ -2246,7 +2242,7 @@ char* ftostr52(const float& x) {
2246 2242
    *   - Click saves the Z and goes to the next mesh point
2247 2243
    */
2248 2244
   static void _lcd_level_bed() {
2249
-    if (encoderPosition != 0) {
2245
+    if ((encoderPosition != 0) && (movesplanned() <= 3)) {
2250 2246
       refresh_cmd_timeout();
2251 2247
       current_position[Z_AXIS] += float((int)encoderPosition) * MBL_Z_STEP;
2252 2248
       if (min_software_endstops) NOLESS(current_position[Z_AXIS], Z_MIN_POS);

Loading…
取消
儲存