Parcourir la source

No lcd_map_control needed in quick_stop

Scott Lahteine il y a 6 ans
Parent
révision
574153a810
3 fichiers modifiés avec 20 ajouts et 16 suppressions
  1. 1
    6
      Marlin/stepper.cpp
  2. 2
    1
      Marlin/stepper.h
  3. 17
    9
      Marlin/ultralcd.cpp

+ 1
- 6
Marlin/stepper.cpp Voir le fichier

@@ -1224,12 +1224,7 @@ void Stepper::finish_and_disable() {
1224 1224
 }
1225 1225
 
1226 1226
 void Stepper::quick_stop() {
1227
-  #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL)
1228
-    if (!ubl.lcd_map_control)
1229
-      cleaning_buffer_counter = 5000;
1230
-  #else
1231
-    cleaning_buffer_counter = 5000;
1232
-  #endif
1227
+  cleaning_buffer_counter = 5000;
1233 1228
   DISABLE_STEPPER_DRIVER_INTERRUPT();
1234 1229
   while (planner.blocks_queued()) planner.discard_current_block();
1235 1230
   current_block = NULL;

+ 2
- 1
Marlin/stepper.h Voir le fichier

@@ -101,10 +101,11 @@ class Stepper {
101 101
       static uint32_t motor_current_setting[3];
102 102
     #endif
103 103
 
104
+    static int16_t cleaning_buffer_counter;
105
+
104 106
   private:
105 107
 
106 108
     static uint8_t last_direction_bits;        // The next stepping-bits to be output
107
-    static int16_t cleaning_buffer_counter;
108 109
 
109 110
     #if ENABLED(X_DUAL_ENDSTOPS)
110 111
       static bool locked_x_motor, locked_x2_motor;

+ 17
- 9
Marlin/ultralcd.cpp Voir le fichier

@@ -559,7 +559,7 @@ uint16_t max_display_update_time = 0;
559 559
     if (no_reentry) return;
560 560
     // Make this the current handler till all moves are done
561 561
     no_reentry = true;
562
-    screenFunc_t old_screen = currentScreen;
562
+    const screenFunc_t old_screen = currentScreen;
563 563
     lcd_goto_screen(_lcd_synchronize);
564 564
     stepper.synchronize();
565 565
     no_reentry = false;
@@ -2336,6 +2336,19 @@ void kill_screen(const char* lcd_msg) {
2336 2336
     void set_current_from_steppers_for_axis(const AxisEnum axis);
2337 2337
     void sync_plan_position();
2338 2338
 
2339
+    void _lcd_do_nothing() {}
2340
+    void _lcd_hard_stop() {
2341
+      stepper.quick_stop();
2342
+      const screenFunc_t old_screen = currentScreen;
2343
+      currentScreen = _lcd_do_nothing;
2344
+      while (planner.movesplanned()) idle();
2345
+      currentScreen = old_screen;
2346
+      stepper.cleaning_buffer_counter = 0;
2347
+      set_current_from_steppers_for_axis(ALL_AXES);
2348
+      sync_plan_position();
2349
+      refresh_cmd_timeout();
2350
+    }
2351
+
2339 2352
     void _lcd_ubl_output_map_lcd() {
2340 2353
       static int16_t step_scaler = 0;
2341 2354
 
@@ -2380,15 +2393,10 @@ void kill_screen(const char* lcd_msg) {
2380 2393
       if (lcdDrawUpdate) {
2381 2394
         lcd_implementation_ubl_plot(x_plot, y_plot);
2382 2395
 
2383
-        ubl_map_move_to_xy(); // Move to current location
2396
+        if (planner.movesplanned()) // If the nozzle is already moving, cancel the move.
2397
+          _lcd_hard_stop();
2384 2398
 
2385
-        if (planner.movesplanned() > 1) { // if the nozzle is moving, cancel the move.  There is a new location
2386
-          stepper.quick_stop();
2387
-          set_current_from_steppers_for_axis(ALL_AXES);
2388
-          sync_plan_position();
2389
-          ubl_map_move_to_xy(); // Move to new location
2390
-          refresh_cmd_timeout();
2391
-        }
2399
+        ubl_map_move_to_xy();       // Move to new location
2392 2400
       }
2393 2401
     }
2394 2402
 

Chargement…
Annuler
Enregistrer