Quellcode durchsuchen

Merge pull request #6307 from thinkyhead/rc_less_no_reentrance

Only lcd_synchronize needs no_reentry
Scott Lahteine vor 8 Jahren
Ursprung
Commit
48c16fc6ef
1 geänderte Dateien mit 8 neuen und 16 gelöschten Zeilen
  1. 8
    16
      Marlin/ultralcd.cpp

+ 8
- 16
Marlin/ultralcd.cpp Datei anzeigen

408
   bool screen_changed;
408
   bool screen_changed;
409
 
409
 
410
   // LCD and menu clicks
410
   // LCD and menu clicks
411
-  bool lcd_clicked, wait_for_unclick, defer_return_to_status, no_reentrance;
411
+  bool lcd_clicked, wait_for_unclick, defer_return_to_status;
412
 
412
 
413
   // Variables used when editing values.
413
   // Variables used when editing values.
414
   const char* editLabel;
414
   const char* editLabel;
460
   extern uint8_t commands_in_queue;
460
   extern uint8_t commands_in_queue;
461
 
461
 
462
   inline void lcd_synchronize() {
462
   inline void lcd_synchronize() {
463
+    static bool no_reentry = false;
463
     lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_MOVING));
464
     lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_MOVING));
464
-    if (no_reentrance) return;
465
-    no_reentrance = true;
465
+    if (no_reentry) return;
466
+    no_reentry = true;
466
     screenFunc_t old_screen = currentScreen;
467
     screenFunc_t old_screen = currentScreen;
467
     lcd_goto_screen(lcd_synchronize);
468
     lcd_goto_screen(lcd_synchronize);
468
     while (commands_in_queue) {
469
     while (commands_in_queue) {
469
       idle();
470
       idle();
470
       stepper.synchronize();
471
       stepper.synchronize();
471
     }
472
     }
472
-    no_reentrance = false;
473
+    no_reentry = false;
473
     lcd_goto_screen(old_screen);
474
     lcd_goto_screen(old_screen);
474
   }
475
   }
475
 
476
 
1365
 
1366
 
1366
       // Utility to go to the next mesh point
1367
       // Utility to go to the next mesh point
1367
       inline void _manual_probe_goto_xy(float x, float y) {
1368
       inline void _manual_probe_goto_xy(float x, float y) {
1368
-        if (no_reentrance) return;
1369
         #if MANUAL_PROBE_HEIGHT > 0
1369
         #if MANUAL_PROBE_HEIGHT > 0
1370
           current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
1370
           current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
1371
           line_to_current(Z_AXIS);
1371
           line_to_current(Z_AXIS);
1409
     void _lcd_level_bed_get_z() {
1409
     void _lcd_level_bed_get_z() {
1410
       ENCODER_DIRECTION_NORMAL();
1410
       ENCODER_DIRECTION_NORMAL();
1411
 
1411
 
1412
-      if (no_reentrance) goto KeepDrawing;
1413
-
1414
       // Encoder wheel adjusts the Z position
1412
       // Encoder wheel adjusts the Z position
1415
       if (encoderPosition) {
1413
       if (encoderPosition) {
1416
         refresh_cmd_timeout();
1414
         refresh_cmd_timeout();
1492
         }
1490
         }
1493
       }
1491
       }
1494
 
1492
 
1495
-      KeepDrawing:
1496
-
1497
       // Update on first display, then only on updates to Z position
1493
       // Update on first display, then only on updates to Z position
1498
       // Show message above on clicks instead
1494
       // Show message above on clicks instead
1499
       if (lcdDrawUpdate) {
1495
       if (lcdDrawUpdate) {
1745
     // Move directly to the tower position with uninterpolated moves
1741
     // Move directly to the tower position with uninterpolated moves
1746
     // If we used interpolated moves it would cause this to become re-entrant
1742
     // If we used interpolated moves it would cause this to become re-entrant
1747
     void _goto_tower_pos(const float &a) {
1743
     void _goto_tower_pos(const float &a) {
1748
-      if (no_reentrance) return;
1749
-
1750
       current_position[Z_AXIS] = max(Z_HOMING_HEIGHT, Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5;
1744
       current_position[Z_AXIS] = max(Z_HOMING_HEIGHT, Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5;
1751
       line_to_current(Z_AXIS);
1745
       line_to_current(Z_AXIS);
1752
 
1746
 
1981
     #if ENABLED(DELTA)
1975
     #if ENABLED(DELTA)
1982
       #define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height)
1976
       #define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height)
1983
       void lcd_lower_z_to_clip_height() {
1977
       void lcd_lower_z_to_clip_height() {
1984
-        if (!no_reentrance) {
1985
-          current_position[Z_AXIS] = delta_clip_start_height;
1986
-          line_to_current(Z_AXIS);
1987
-          lcd_synchronize();
1988
-        }
1978
+        current_position[Z_AXIS] = delta_clip_start_height;
1979
+        line_to_current(Z_AXIS);
1980
+        lcd_synchronize();
1989
       }
1981
       }
1990
     #else
1982
     #else
1991
       #define _MOVE_XY_ALLOWED true
1983
       #define _MOVE_XY_ALLOWED true

Laden…
Abbrechen
Speichern