Bladeren bron

No lcd_map_control flag in quick_stop

Scott Lahteine 6 jaren geleden
bovenliggende
commit
9898b96992
3 gewijzigde bestanden met toevoegingen van 22 en 17 verwijderingen
  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 Bestand weergeven

@@ -2307,11 +2307,12 @@ void kill_screen(const char* lcd_msg) {
2307 2307
 
2308 2308
     void _lcd_ubl_map_homing() {
2309 2309
       defer_return_to_status = true;
2310
-      ubl.lcd_map_control = true; // Return to the map screen
2311 2310
       if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT < 3 ? 0 : (LCD_HEIGHT > 4 ? 2 : 1), PSTR(MSG_LEVEL_BED_HOMING));
2312 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 2314
         lcd_goto_screen(_lcd_ubl_output_map_lcd);
2315
+      }
2315 2316
     }
2316 2317
 
2317 2318
     /**
@@ -2341,6 +2342,19 @@ void kill_screen(const char* lcd_msg) {
2341 2342
     void set_current_from_steppers_for_axis(const AxisEnum axis);
2342 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 2358
     void _lcd_ubl_output_map_lcd() {
2345 2359
       static int16_t step_scaler = 0;
2346 2360
 
@@ -2385,15 +2399,10 @@ void kill_screen(const char* lcd_msg) {
2385 2399
       if (lcdDrawUpdate) {
2386 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 Bestand weergeven

@@ -1219,12 +1219,7 @@ void Stepper::finish_and_disable() {
1219 1219
 }
1220 1220
 
1221 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 1223
   DISABLE_STEPPER_DRIVER_INTERRUPT();
1229 1224
   while (planner.blocks_queued()) planner.discard_current_block();
1230 1225
   current_block = NULL;

+ 2
- 1
Marlin/src/module/stepper.h Bestand weergeven

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

Laden…
Annuleren
Opslaan