diff --git a/Marlin/src/gcode/bedlevel/G42.cpp b/Marlin/src/gcode/bedlevel/G42.cpp index 2a4737e8a7..f55f149616 100644 --- a/Marlin/src/gcode/bedlevel/G42.cpp +++ b/Marlin/src/gcode/bedlevel/G42.cpp @@ -27,9 +27,12 @@ #include "../gcode.h" #include "../../MarlinCore.h" // for IsRunning() #include "../../module/motion.h" -#include "../../module/probe.h" // for probe.offset #include "../../feature/bedlevel/bedlevel.h" +#if HAS_PROBE_XY_OFFSET + #include "../../module/probe.h" // for probe.offset +#endif + /** * G42: Move X & Y axes to mesh coordinates (I & J) * diff --git a/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin/src/gcode/bedlevel/M420.cpp index c495da3018..8711bab9c8 100644 --- a/Marlin/src/gcode/bedlevel/M420.cpp +++ b/Marlin/src/gcode/bedlevel/M420.cpp @@ -27,7 +27,10 @@ #include "../gcode.h" #include "../../feature/bedlevel/bedlevel.h" #include "../../module/planner.h" -#include "../../module/probe.h" + +#if ENABLED(MARLIN_DEV_MODE) + #include "../../module/probe.h" +#endif #if ENABLED(EEPROM_SETTINGS) #include "../../module/settings.h" diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 0ab1ca6105..7468e1fc39 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -40,7 +40,9 @@ #include "../../feature/tmc_util.h" #endif -#include "../../module/probe.h" +#if HAS_BED_PROBE + #include "../../module/probe.h" +#endif #if ENABLED(BLTOUCH) #include "../../feature/bltouch.h" diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp index 19b2cd8597..e3f748bf8d 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp @@ -38,8 +38,10 @@ #include "../../../sd/cardreader.h" #include "../../../module/planner.h" #include "../../../module/servo.h" -#include "../../../module/probe.h" +#if HAS_Z_SERVO_PROBE + #include "../../../module/probe.h" +#endif #if DISABLED(EMERGENCY_PARSER) #include "../../../module/motion.h" #endif diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 77de555379..ae7702e8a4 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -50,7 +50,6 @@ #include "../../gcode/gcode.h" #include "../../module/motion.h" #include "../../module/planner.h" -#include "../../module/probe.h" #include "../../module/temperature.h" #include "../../module/printcounter.h" #include "../../libs/duration_t.h" @@ -82,6 +81,10 @@ #include "../../feature/backlash.h" #endif +#if HAS_BED_PROBE + #include "../../module/probe.h" +#endif + #if HAS_LEVELING #include "../../feature/bedlevel/bedlevel.h" #endif