Explorar o código

Merge pull request #714 from mkbel/hot_fix_move_axis

Hot fix: Can not move X and Y axis in stealth mode, when the printer …
PavelSindler %!s(int64=6) %!d(string=hai) anos
pai
achega
d39343f92d
Modificáronse 1 ficheiros con 13 adicións e 2 borrados
  1. 13 2
      Firmware/ultralcd.cpp

+ 13 - 2
Firmware/ultralcd.cpp

@@ -114,6 +114,11 @@ union MenuData
         //Timer timer;
 		char dummy;
     } autoLoadFilamentMenu;
+    struct _Lcd_moveMenu
+    {
+        bool initialized;
+        bool endstopsEnabledPrevious;
+    } _lcd_moveMenu;
 };
 
 // State of the currently active menu.
@@ -2236,6 +2241,12 @@ void lcd_menu_statistics()
 
 
 static void _lcd_move(const char *name, int axis, int min, int max) {
+    if (!menuData._lcd_moveMenu.initialized)
+    {
+        menuData._lcd_moveMenu.endstopsEnabledPrevious = enable_endstops(false);
+        menuData._lcd_moveMenu.initialized = true;
+    }
+
 	if (encoderPosition != 0) {
     refresh_cmd_timeout();
     if (! planner_queue_full()) {
@@ -2249,8 +2260,8 @@ static void _lcd_move(const char *name, int axis, int min, int max) {
     }
   }
   if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis]));
-  if (LCD_CLICKED) menu_action_back(); {
-  }
+  if (menuExiting || LCD_CLICKED) (void)enable_endstops(menuData._lcd_moveMenu.endstopsEnabledPrevious);
+  if (LCD_CLICKED) menu_action_back();
 }