From 41b5c48129affe05f438d1814acf2d5371fdc09e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 19 Aug 2016 01:00:46 -0500 Subject: [PATCH] Update software endstops if EEPROM is loaded --- Marlin/Marlin.h | 1 + Marlin/Marlin_main.cpp | 2 +- Marlin/configuration_store.cpp | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 28c3250a30..2faeb9f867 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -379,6 +379,7 @@ extern uint8_t active_extruder; extern float mixing_factor[MIXING_STEPPERS]; #endif +void update_software_endstops(AxisEnum axis); void calculate_volumetric_multipliers(); // Buzzer diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0a385622bc..af4312071d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1470,7 +1470,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); * the software endstop positions must be refreshed to remain * at the same positions relative to the machine. */ -static void update_software_endstops(AxisEnum axis) { +void update_software_endstops(AxisEnum axis) { float offs = LOGICAL_POSITION(0, axis); #if ENABLED(DUAL_X_CARRIAGE) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index db10bba150..f54cd88a2f 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -186,6 +186,9 @@ void Config_Postprocess() { #endif calculate_volumetric_multipliers(); + + // Software endstops depend on home_offset + LOOP_XYZ(i) update_software_endstops((AxisEnum)i); } #if ENABLED(EEPROM_SETTINGS)