Pārlūkot izejas kodu

Smaller code in G28

Replace two blocks of code with already defined functions.

Change saves 100 bytes of flash memory and 11 lines of code.
Guðni Már Gilbert 3 gadi atpakaļ
vecāks
revīzija
7787f17139
1 mainītis faili ar 2 papildinājumiem un 13 dzēšanām
  1. 2 13
      Firmware/Marlin_main.cpp

+ 2 - 13
Firmware/Marlin_main.cpp

@@ -2817,12 +2817,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
       if (home_z)
         babystep_undo();
 
-      saved_feedrate = feedrate;
-      int l_feedmultiply = feedmultiply;
-      feedmultiply = 100;
-      previous_millis_cmd.start();
-
-      enable_endstops(true);
+      int l_feedmultiply = setup_for_endstop_move();
 
       set_destination_to_current();
       feedrate = 0.0;
@@ -2997,13 +2992,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
       // contains the machine coordinates.
       plan_set_position_curposXYZE();
 
-      #ifdef ENDSTOPS_ONLY_FOR_HOMING
-        enable_endstops(false);
-      #endif
-
-      feedrate = saved_feedrate;
-      feedmultiply = l_feedmultiply;
-      previous_millis_cmd.start();
+      clean_up_after_endstop_move(l_feedmultiply);
       endstops_hit_on_purpose();
 #ifndef MESH_BED_LEVELING
 //-// Oct 2019 :: this part of code is (from) now probably un-compilable