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.
This commit is contained in:
parent
b835f31904
commit
7787f17139
|
|
@ -2817,12 +2817,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
||||||
if (home_z)
|
if (home_z)
|
||||||
babystep_undo();
|
babystep_undo();
|
||||||
|
|
||||||
saved_feedrate = feedrate;
|
int l_feedmultiply = setup_for_endstop_move();
|
||||||
int l_feedmultiply = feedmultiply;
|
|
||||||
feedmultiply = 100;
|
|
||||||
previous_millis_cmd.start();
|
|
||||||
|
|
||||||
enable_endstops(true);
|
|
||||||
|
|
||||||
set_destination_to_current();
|
set_destination_to_current();
|
||||||
feedrate = 0.0;
|
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.
|
// contains the machine coordinates.
|
||||||
plan_set_position_curposXYZE();
|
plan_set_position_curposXYZE();
|
||||||
|
|
||||||
#ifdef ENDSTOPS_ONLY_FOR_HOMING
|
clean_up_after_endstop_move(l_feedmultiply);
|
||||||
enable_endstops(false);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
feedrate = saved_feedrate;
|
|
||||||
feedmultiply = l_feedmultiply;
|
|
||||||
previous_millis_cmd.start();
|
|
||||||
endstops_hit_on_purpose();
|
endstops_hit_on_purpose();
|
||||||
#ifndef MESH_BED_LEVELING
|
#ifndef MESH_BED_LEVELING
|
||||||
//-// Oct 2019 :: this part of code is (from) now probably un-compilable
|
//-// Oct 2019 :: this part of code is (from) now probably un-compilable
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue