浏览代码

No lcd_map_control flag in quick_stop

Scott Lahteine 7 年前
父节点
当前提交
9898b96992
共有 3 个文件被更改,包括 22 次插入17 次删除
  1. 19
    10
      Marlin/src/lcd/ultralcd.cpp
  2. 1
    6
      Marlin/src/module/stepper.cpp
  3. 2
    1
      Marlin/src/module/stepper.h

+ 19
- 10
Marlin/src/lcd/ultralcd.cpp 查看文件

2307
 
2307
 
2308
     void _lcd_ubl_map_homing() {
2308
     void _lcd_ubl_map_homing() {
2309
       defer_return_to_status = true;
2309
       defer_return_to_status = true;
2310
-      ubl.lcd_map_control = true; // Return to the map screen
2311
       if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT < 3 ? 0 : (LCD_HEIGHT > 4 ? 2 : 1), PSTR(MSG_LEVEL_BED_HOMING));
2310
       if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT < 3 ? 0 : (LCD_HEIGHT > 4 ? 2 : 1), PSTR(MSG_LEVEL_BED_HOMING));
2312
       lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW;
2311
       lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW;
2313
-      if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
2312
+      if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) {
2313
+        ubl.lcd_map_control = true; // Return to the map screen
2314
         lcd_goto_screen(_lcd_ubl_output_map_lcd);
2314
         lcd_goto_screen(_lcd_ubl_output_map_lcd);
2315
+      }
2315
     }
2316
     }
2316
 
2317
 
2317
     /**
2318
     /**
2341
     void set_current_from_steppers_for_axis(const AxisEnum axis);
2342
     void set_current_from_steppers_for_axis(const AxisEnum axis);
2342
     void sync_plan_position();
2343
     void sync_plan_position();
2343
 
2344
 
2345
+    void _lcd_do_nothing() {}
2346
+    void _lcd_hard_stop() {
2347
+      stepper.quick_stop();
2348
+      const screenFunc_t old_screen = currentScreen;
2349
+      currentScreen = _lcd_do_nothing;
2350
+      while (planner.movesplanned()) idle();
2351
+      currentScreen = old_screen;
2352
+      stepper.cleaning_buffer_counter = 0;
2353
+      set_current_from_steppers_for_axis(ALL_AXES);
2354
+      sync_plan_position();
2355
+      gcode.refresh_cmd_timeout();
2356
+    }
2357
+
2344
     void _lcd_ubl_output_map_lcd() {
2358
     void _lcd_ubl_output_map_lcd() {
2345
       static int16_t step_scaler = 0;
2359
       static int16_t step_scaler = 0;
2346
 
2360
 
2385
       if (lcdDrawUpdate) {
2399
       if (lcdDrawUpdate) {
2386
         lcd_implementation_ubl_plot(x_plot, y_plot);
2400
         lcd_implementation_ubl_plot(x_plot, y_plot);
2387
 
2401
 
2388
-        ubl_map_move_to_xy(); // Move to current location
2402
+        if (planner.movesplanned()) // If the nozzle is already moving, cancel the move.
2403
+          _lcd_hard_stop();
2389
 
2404
 
2390
-        if (planner.movesplanned() > 1) { // if the nozzle is moving, cancel the move.  There is a new location
2391
-          stepper.quick_stop();
2392
-          set_current_from_steppers_for_axis(ALL_AXES);
2393
-          sync_plan_position();
2394
-          ubl_map_move_to_xy(); // Move to new location
2395
-          gcode.refresh_cmd_timeout();
2396
-        }
2405
+        ubl_map_move_to_xy();       // Move to new location
2397
       }
2406
       }
2398
     }
2407
     }
2399
 
2408
 

+ 1
- 6
Marlin/src/module/stepper.cpp 查看文件

1219
 }
1219
 }
1220
 
1220
 
1221
 void Stepper::quick_stop() {
1221
 void Stepper::quick_stop() {
1222
-
1223
-  #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL)
1224
-    if (!ubl.lcd_map_control)
1225
-  #endif
1226
-      cleaning_buffer_counter = 5000;
1227
-
1222
+  cleaning_buffer_counter = 5000;
1228
   DISABLE_STEPPER_DRIVER_INTERRUPT();
1223
   DISABLE_STEPPER_DRIVER_INTERRUPT();
1229
   while (planner.blocks_queued()) planner.discard_current_block();
1224
   while (planner.blocks_queued()) planner.discard_current_block();
1230
   current_block = NULL;
1225
   current_block = NULL;

+ 2
- 1
Marlin/src/module/stepper.h 查看文件

77
       static uint32_t motor_current_setting[3];
77
       static uint32_t motor_current_setting[3];
78
     #endif
78
     #endif
79
 
79
 
80
+    static int16_t cleaning_buffer_counter;
81
+
80
   private:
82
   private:
81
 
83
 
82
     static uint8_t last_direction_bits;        // The next stepping-bits to be output
84
     static uint8_t last_direction_bits;        // The next stepping-bits to be output
83
-    static int16_t cleaning_buffer_counter;
84
 
85
 
85
     #if ENABLED(X_DUAL_ENDSTOPS)
86
     #if ENABLED(X_DUAL_ENDSTOPS)
86
       static bool locked_x_motor, locked_x2_motor;
87
       static bool locked_x_motor, locked_x2_motor;

正在加载...
取消
保存