diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 5b830d670497359ee81ebc04d3ca540064751522..c933b6887c6c871b6a657c7d71e415f24de1bd42 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -760,6 +760,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/default/Configuration.h b/Marlin/src/config/default/Configuration.h
index 12487af70b89e486bea22f994df05ffcdb213bd0..526d01f7d60197479f91b584e4d78b55b6c07716 100644
--- a/Marlin/src/config/default/Configuration.h
+++ b/Marlin/src/config/default/Configuration.h
@@ -760,6 +760,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h
index 781960bac90bb876a3c6389be70e6427ad7ff2eb..473e79221d3bbd62c8f3711205847da9ae76c312 100644
--- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h
+++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h
@@ -780,6 +780,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h b/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h
index f69fa83ae6fe57f865032e47ec8b2c8d497f90e9..0d51160b355508bbe0cf926abd187d303448df75 100644
--- a/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h
+++ b/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h
@@ -760,6 +760,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/Anet/A6/Configuration.h b/Marlin/src/config/examples/Anet/A6/Configuration.h
index 8de7329d0dff699db7d3fcb238de565f45b0cafb..e0b0edc45b66f13bea16db16be5a095beb653c84 100644
--- a/Marlin/src/config/examples/Anet/A6/Configuration.h
+++ b/Marlin/src/config/examples/Anet/A6/Configuration.h
@@ -844,6 +844,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/Anet/A8/Configuration.h b/Marlin/src/config/examples/Anet/A8/Configuration.h
index 52d49c4f48ec32e3472a25ff7b5e10995d281741..15f4297e7bdd6742584f337fb8610886a461f0d8 100644
--- a/Marlin/src/config/examples/Anet/A8/Configuration.h
+++ b/Marlin/src/config/examples/Anet/A8/Configuration.h
@@ -766,6 +766,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration.h
index 31052af022308f9eda68ecee4fe572ebe7d0f1e1..c2869942777370f30a062aa8926f9e361540242c 100644
--- a/Marlin/src/config/examples/BQ/Hephestos/Configuration.h
+++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration.h
@@ -751,6 +751,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration.h
index 352f8e23fdbe04339209642e076714b47df88870..b3a5c24f94b21530b7f933de66dc8c93ed3acf0b 100644
--- a/Marlin/src/config/examples/BQ/WITBOX/Configuration.h
+++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration.h
@@ -751,6 +751,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/Cartesio/Configuration.h b/Marlin/src/config/examples/Cartesio/Configuration.h
index b2125597b9d496c601681e24f095073fa8dbd858..af096eeaad1570011e091b021f0902d0e0d61f5c 100644
--- a/Marlin/src/config/examples/Cartesio/Configuration.h
+++ b/Marlin/src/config/examples/Cartesio/Configuration.h
@@ -759,6 +759,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration.h b/Marlin/src/config/examples/Creality/CR-10/Configuration.h
index bb4096acfb3f49543dd79f825310939d96dc57a8..ab832f5aaa99b748cb450c5f98f39ed710c787ea 100644
--- a/Marlin/src/config/examples/Creality/CR-10/Configuration.h
+++ b/Marlin/src/config/examples/Creality/CR-10/Configuration.h
@@ -770,6 +770,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 5 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/Felix/Configuration.h b/Marlin/src/config/examples/Felix/Configuration.h
index e7d47b2b402b978b9a139f753dc1ccb03389f5fa..15e9199f18f9a04f9e741199b2e0d0c0c199e913 100644
--- a/Marlin/src/config/examples/Felix/Configuration.h
+++ b/Marlin/src/config/examples/Felix/Configuration.h
@@ -742,6 +742,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/Felix/DUAL/Configuration.h b/Marlin/src/config/examples/Felix/DUAL/Configuration.h
index 3fc18bc428a1c421cbfb94e3ace54a49843897a6..03317d455f65fe132346f6eb1e918a856d005d6a 100644
--- a/Marlin/src/config/examples/Felix/DUAL/Configuration.h
+++ b/Marlin/src/config/examples/Felix/DUAL/Configuration.h
@@ -742,6 +742,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h
index c5ecfba50a4a3dbe4f2fc889b063f88da14bd9b3..dcb66d3ccd60b560c2b6ad21aec7cdafadc5f213 100644
--- a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h
+++ b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h
@@ -775,6 +775,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h
index dace8b46296e6ec3d8f2cb390a02941085b53f1c..b3c9ef5079442176c26062923a4388e61617cd4a 100644
--- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h
+++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h
@@ -764,6 +764,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration.h b/Marlin/src/config/examples/Malyan/M150/Configuration.h
index 2b34b2047d067b95adf225e7be21f4d1ecb32bdb..5f4788b4c8bd1d87bd816a1e26df1adb8ac648ac 100644
--- a/Marlin/src/config/examples/Malyan/M150/Configuration.h
+++ b/Marlin/src/config/examples/Malyan/M150/Configuration.h
@@ -784,6 +784,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h b/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h
index 2a89001e61f8d52e69e6af72df2bfd8964cd21cf..54de5179858f2a9bb87f41dc0c2ff2d48e84f306 100644
--- a/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h
+++ b/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h
@@ -760,6 +760,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/RigidBot/Configuration.h b/Marlin/src/config/examples/RigidBot/Configuration.h
index d534aa6f69407301ed61d3e2b7fa2f09e061fde0..28dd6a8349c91647bf4bb67e107d93ecb3d32684 100644
--- a/Marlin/src/config/examples/RigidBot/Configuration.h
+++ b/Marlin/src/config/examples/RigidBot/Configuration.h
@@ -758,6 +758,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/SCARA/Configuration.h b/Marlin/src/config/examples/SCARA/Configuration.h
index 186eb638e1c0724fdf686b02c23b2cb86ac230e8..203d99b7114c077130dd2394e1de77a6e6687228 100644
--- a/Marlin/src/config/examples/SCARA/Configuration.h
+++ b/Marlin/src/config/examples/SCARA/Configuration.h
@@ -772,6 +772,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration.h b/Marlin/src/config/examples/TinyBoy2/Configuration.h
index 3fd76030f09ff9d623212c219ed58dd0ef50c576..55ff8fddc8ad54308f8bdcddc9bb0625e678c657 100644
--- a/Marlin/src/config/examples/TinyBoy2/Configuration.h
+++ b/Marlin/src/config/examples/TinyBoy2/Configuration.h
@@ -811,6 +811,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration.h b/Marlin/src/config/examples/Velleman/K8400/Configuration.h
index 1c3d7d616fc43a460a81d5aaf5c06e67cb4ef1ea..be0030f039f9f5fedf138a142373b6a4d4b1b887 100644
--- a/Marlin/src/config/examples/Velleman/K8400/Configuration.h
+++ b/Marlin/src/config/examples/Velleman/K8400/Configuration.h
@@ -760,6 +760,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h b/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h
index 716e54a0547eb40484ffb46c7d25820844cebc01..e40bcade8009838f811bf851e82ff0f1cd137b28 100644
--- a/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h
+++ b/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h
@@ -760,6 +760,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/adafruit/ST7565/Configuration.h b/Marlin/src/config/examples/adafruit/ST7565/Configuration.h
index 0e4cb66a1a2320779565750f98bae5cc0c016547..7ed947b62bec0ad1bcde5ecd6623eb29567c03a3 100644
--- a/Marlin/src/config/examples/adafruit/ST7565/Configuration.h
+++ b/Marlin/src/config/examples/adafruit/ST7565/Configuration.h
@@ -760,6 +760,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/delta/generic/Configuration.h b/Marlin/src/config/examples/delta/generic/Configuration.h
index 895e5799b74e370dc032bdffb12d79bd0f20b7c8..0dfe304e2986c25da268cfd03651b563019b8433 100644
--- a/Marlin/src/config/examples/delta/generic/Configuration.h
+++ b/Marlin/src/config/examples/delta/generic/Configuration.h
@@ -871,6 +871,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration.h
index c7498aad5bb6fc490e00a609297258e7d8cf37ee..e0f59056d072a26ccb1731745e09238dd0829a77 100644
--- a/Marlin/src/config/examples/delta/kossel_mini/Configuration.h
+++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration.h
@@ -874,6 +874,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 15 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/delta/kossel_pro/Configuration.h b/Marlin/src/config/examples/delta/kossel_pro/Configuration.h
index f6b9e3a961134f38f85c89872324c6edd932aa7a..0b5fb3d2a7beb30ad4ebec9345ca7d4d25e408a9 100644
--- a/Marlin/src/config/examples/delta/kossel_pro/Configuration.h
+++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration.h
@@ -874,6 +874,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration.h
index 8ee9d56eb55e30826e542dab66b381ddfd7dd8c9..759067f7cb975b76abb37ebfceaf68146b34a77f 100644
--- a/Marlin/src/config/examples/delta/kossel_xl/Configuration.h
+++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration.h
@@ -883,6 +883,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/makibox/Configuration.h b/Marlin/src/config/examples/makibox/Configuration.h
index 4853f95ec25c5e2c94feb93b20bf1a10a7ac02a7..08fea9160d10f439c2f9f78746a2fb7f38243d39 100644
--- a/Marlin/src/config/examples/makibox/Configuration.h
+++ b/Marlin/src/config/examples/makibox/Configuration.h
@@ -763,6 +763,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/stm32f103ret6/Configuration.h b/Marlin/src/config/examples/stm32f103ret6/Configuration.h
index a4b395403c3f0cc66fca770b3fd7e172e0331e6a..0d0b0ce1becaf291d5775046d55d3fe163452f25 100644
--- a/Marlin/src/config/examples/stm32f103ret6/Configuration.h
+++ b/Marlin/src/config/examples/stm32f103ret6/Configuration.h
@@ -746,6 +746,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration.h
index efe3e1e85f984a563c84e286ab140e6849557471..1f0cd8fff1cc20976cff8620f14a4a54863a6870 100644
--- a/Marlin/src/config/examples/tvrrug/Round2/Configuration.h
+++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration.h
@@ -755,6 +755,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/config/examples/wt150/Configuration.h b/Marlin/src/config/examples/wt150/Configuration.h
index d4cc69bbefeab8f7b1572c8dd77fc07bbfe71581..e185358b2a2a5625d0d30b23048f995e20327f0d 100644
--- a/Marlin/src/config/examples/wt150/Configuration.h
+++ b/Marlin/src/config/examples/wt150/Configuration.h
@@ -765,6 +765,8 @@
// @section homing
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
+
//#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.
diff --git a/Marlin/src/gcode/bedlevel/G42.cpp b/Marlin/src/gcode/bedlevel/G42.cpp
index c46415b7db9433475f26df32d5b9d1a1331997d9..f734fa8c86dc4fc62545bcf8f97e414546d408f1 100644
--- a/Marlin/src/gcode/bedlevel/G42.cpp
+++ b/Marlin/src/gcode/bedlevel/G42.cpp
@@ -33,7 +33,7 @@
* G42: Move X & Y axes to mesh coordinates (I & J)
*/
void GcodeSuite::G42() {
- if (IsRunning()) {
+ if (MOTION_CONDITIONS) {
const bool hasI = parser.seenval('I');
const int8_t ix = hasI ? parser.value_int() : 0;
const bool hasJ = parser.seenval('J');
diff --git a/Marlin/src/gcode/motion/G0_G1.cpp b/Marlin/src/gcode/motion/G0_G1.cpp
index d2fe3f98b25f3c069f7ccc7b875aa2ce30260c0e..1d34cb667a51e8baead7d60d28bacec251f197ad 100644
--- a/Marlin/src/gcode/motion/G0_G1.cpp
+++ b/Marlin/src/gcode/motion/G0_G1.cpp
@@ -41,7 +41,7 @@ void GcodeSuite::G0_G1(
bool fast_move/*=false*/
#endif
) {
- if (IsRunning()) {
+ if (MOTION_CONDITIONS) {
get_destination_from_command(); // For X Y Z E F
#if ENABLED(FWRETRACT)
diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp
index 44f0f53ba70192a64f6a79a2da80589e1564cdbc..15fd7f7b9e229217e8fa2292899c9dd1da3fe67d 100644
--- a/Marlin/src/gcode/motion/G2_G3.cpp
+++ b/Marlin/src/gcode/motion/G2_G3.cpp
@@ -211,7 +211,7 @@ void plan_arc(
* G3 X20 Y12 R14 ; CCW circle with r=14 ending at X20 Y12
*/
void GcodeSuite::G2_G3(const bool clockwise) {
- if (IsRunning()) {
+ if (MOTION_CONDITIONS) {
#if ENABLED(SF_ARC_FIX)
const bool relative_mode_backup = relative_mode;
diff --git a/Marlin/src/gcode/motion/G5.cpp b/Marlin/src/gcode/motion/G5.cpp
index a09f588961399a658dd382f4dfecb1b2f31e3058..9df590b029e8f4a0a784ad4e2ea811cce3fee410 100644
--- a/Marlin/src/gcode/motion/G5.cpp
+++ b/Marlin/src/gcode/motion/G5.cpp
@@ -50,7 +50,7 @@ void plan_cubic_move(const float offset[4]) {
* G5: Cubic B-spline
*/
void GcodeSuite::G5() {
- if (IsRunning()) {
+ if (MOTION_CONDITIONS) {
#if ENABLED(CNC_WORKSPACE_PLANES)
if (workspace_plane != PLANE_XY) {
diff --git a/Marlin/src/inc/SPI.h b/Marlin/src/inc/SPI.h
index 237bf27430af310ff0869c739a29ef1f6b5176a9..3fa0cecceba47f3153810ae5d9e82eff019f4347 100644
--- a/Marlin/src/inc/SPI.h
+++ b/Marlin/src/inc/SPI.h
@@ -1,7 +1,7 @@
#include <stdint.h>
-#if !defined(SPI_FULL_SPEED)
+#ifndef SPI_FULL_SPEED
/**
* SPI speed where 0 <= index <= 6
diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h
index 3609c4a3469746ff0e4dca18f54ef7631434970d..404e93b6d3138784125adccc26ceedf0154a6a27 100644
--- a/Marlin/src/inc/SanityCheck.h
+++ b/Marlin/src/inc/SanityCheck.h
@@ -632,7 +632,7 @@ static_assert(1 >= 0
/**
* Make sure Z raise values are set
*/
- #if !defined(Z_CLEARANCE_DEPLOY_PROBE)
+ #ifndef Z_CLEARANCE_DEPLOY_PROBE
#error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
#elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
#error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp
index 2db06d53165613a164b00ca96c9e0825dbab85bc..9a19104d71138c7f3000dd30bb1475653a277fcc 100644
--- a/Marlin/src/lcd/ultralcd.cpp
+++ b/Marlin/src/lcd/ultralcd.cpp
@@ -2928,19 +2928,19 @@ void kill_screen(const char* lcd_msg) {
*
*/
- #if IS_KINEMATIC
+ #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING)
#define _MOVE_XYZ_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
- #if ENABLED(DELTA)
- #define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height)
- void lcd_lower_z_to_clip_height() {
- line_to_z(delta_clip_start_height);
- lcd_synchronize();
- }
- #else
- #define _MOVE_XY_ALLOWED true
- #endif
#else
#define _MOVE_XYZ_ALLOWED true
+ #endif
+
+ #if ENABLED(DELTA)
+ #define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height)
+ void lcd_lower_z_to_clip_height() {
+ line_to_z(delta_clip_start_height);
+ lcd_synchronize();
+ }
+ #else
#define _MOVE_XY_ALLOWED true
#endif
diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp
index 407dd756b8875c399602af321638a59f56424bea..bb8ca3106a71acdde2b865a687226ad70048618e 100644
--- a/Marlin/src/module/motion.cpp
+++ b/Marlin/src/module/motion.cpp
@@ -51,7 +51,7 @@
#include "../feature/bedlevel/bedlevel.h"
#endif
-#if NEED_UNHOMED_ERR && ENABLED(ULTRA_LCD)
+#if HAS_AXIS_UNHOMED_ERR && ENABLED(ULTRA_LCD)
#include "../lcd/ultralcd.h"
#endif
@@ -820,7 +820,7 @@ void prepare_move_to_destination() {
set_current_to_destination();
}
-#if NEED_UNHOMED_ERR
+#if HAS_AXIS_UNHOMED_ERR
bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) {
#if ENABLED(HOME_AFTER_DEACTIVATE)
@@ -848,7 +848,7 @@ void prepare_move_to_destination() {
return false;
}
-#endif
+#endif // HAS_AXIS_UNHOMED_ERR
/**
* The homing feedrate may vary
diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h
index 084868e58f1a59e1552ca78d878884ec14a06a06..5da373354bfb1c4bb9d896e6ad8e0bc774c3df71 100644
--- a/Marlin/src/module/motion.h
+++ b/Marlin/src/module/motion.h
@@ -167,12 +167,26 @@ void clean_up_after_endstop_or_probe_move();
// Homing
//
-#define NEED_UNHOMED_ERR (HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) || ENABLED(DELTA_AUTO_CALIBRATION))
-
-#if NEED_UNHOMED_ERR
+#define HAS_AXIS_UNHOMED_ERR ( \
+ ENABLED(Z_PROBE_ALLEN_KEY) \
+ || ENABLED(Z_PROBE_SLED) \
+ || HAS_PROBING_PROCEDURE \
+ || HOTENDS > 1 \
+ || ENABLED(NOZZLE_CLEAN_FEATURE) \
+ || ENABLED(NOZZLE_PARK_FEATURE) \
+ || (ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(HOME_BEFORE_FILAMENT_CHANGE)) \
+ ) || ENABLED(NO_MOTION_BEFORE_HOMING)
+
+#if HAS_AXIS_UNHOMED_ERR
bool axis_unhomed_error(const bool x=true, const bool y=true, const bool z=true);
#endif
+#if ENABLED(NO_MOTION_BEFORE_HOMING)
+ #define MOTION_CONDITIONS (IsRunning() && !axis_unhomed_error())
+#else
+ #define MOTION_CONDITIONS IsRunning()
+#endif
+
void set_axis_is_at_home(const AxisEnum axis);
void homeaxis(const AxisEnum axis);
diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp
index 9c044b0d37dd15271dcbb41bf3aef235643b4e5c..98185f6a5b81263ff8f6f3475b768b9ac32791fe 100644
--- a/Marlin/src/module/probe.cpp
+++ b/Marlin/src/module/probe.cpp
@@ -276,7 +276,7 @@ inline void do_probe_raise(const float z_raise) {
#endif
}
-#endif
+#endif // Z_PROBE_ALLEN_KEY
#if ENABLED(PROBING_FANS_OFF)
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index bd553c8a9755594c9f9ba07bfd78a807db30ae96..b95d223561d8f3da356c52a348007358d8aaf738 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -323,7 +323,7 @@ void Stepper::isr() {
HAL_TIMER_TYPE ocr_val;
- #if defined(CPU_32_BIT)
+ #ifdef CPU_32_BIT
#define ENDSTOP_NOMINAL_OCR_VAL 1500 * HAL_TICKS_PER_US // check endstops every 1.5ms to guarantee two stepper ISRs within 5ms for BLTouch
#define OCR_VAL_TOLERANCE 500 * HAL_TICKS_PER_US // First max delay is 2.0ms, last min delay is 0.5ms, all others 1.5ms
#else
@@ -335,7 +335,7 @@ void Stepper::isr() {
// Disable Timer0 ISRs and enable global ISR again to capture UART events (incoming chars)
DISABLE_TEMPERATURE_INTERRUPT(); // Temperature ISR
DISABLE_STEPPER_DRIVER_INTERRUPT();
- #if !defined(CPU_32_BIT)
+ #ifndef CPU_32_BIT
sei();
#endif
#endif
diff --git a/Marlin/src/pins/pins_ANET_10.h b/Marlin/src/pins/pins_ANET_10.h
index 8668681bf4e0379659ac5f33c5f773eab65426c2..943e1cdfe6480eefba556c8827510fa4e3b7d21d 100644
--- a/Marlin/src/pins/pins_ANET_10.h
+++ b/Marlin/src/pins/pins_ANET_10.h
@@ -88,7 +88,7 @@
* Many thanks to Hans Raaf (@oderwat) for developing the Anet-specific software and supporting the Anet community.
*/
-#if !defined(__AVR_ATmega1284P__)
+#ifndef __AVR_ATmega1284P__
#error "Oops! Make sure you have 'Anet V1.0', 'Anet V1.0 (Optiboot)' or 'Sanguino' selected from the 'Tools -> Boards' menu."
#endif
diff --git a/Marlin/src/pins/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/pins_RAMPS_RE_ARM.h
index 57606c032a8a1deb9b907d97c2711297936f6125..bc33ee4dee45ef9fdb35c7866029d4f6bd8d29da 100644
--- a/Marlin/src/pins/pins_RAMPS_RE_ARM.h
+++ b/Marlin/src/pins/pins_RAMPS_RE_ARM.h
@@ -66,7 +66,7 @@
#define Y_MAX_PIN 15 //10k pullup to 3.3V, 1K series
#define Z_MIN_PIN 18 //10k pullup to 3.3V, 1K series
#define Z_MAX_PIN 19 //10k pullup to 3.3V, 1K series
-//#define Z_probe_pin 1 // AUX-1
+//#define Z_PROBE_PIN 1 // AUX-1
//
@@ -267,23 +267,18 @@
//#define SHIFT_EN 41 // J5-4 & AUX-4
#endif
- #if ENABLED(SDSUPPORT)
- #define SDCARD_SORT_ALPHA // Using SORT feature to keep one directory level in RAM
- // When going up/down directory levels the SD card is
- // accessed but the garbage/lines are removed when the
- // LCD updates
-
- // SD Card Sorting options
- #if ENABLED(SDCARD_SORT_ALPHA)
- #define SDSORT_LIMIT 255 // Maximum number of sorted items (10-256). Costs 27 bytes each.
- #define FOLDER_SORTING -1 // -1=above 0=none 1=below
- #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code.
- #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting.
- #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
- #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option.
- #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
- #endif
- #endif
+ #define SDCARD_SORT_ALPHA // Using SORT feature to keep one directory level in RAM
+ // When going up/down directory levels the SD card is
+ // accessed but the garbage/lines are removed when the
+ // LCD updates
+
+ #define SDSORT_LIMIT 256 // Maximum number of sorted items (10-256). Costs 27 bytes each.
+ #define FOLDER_SORTING -1 // -1=above 0=none 1=below
+ #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code.
+ #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting.
+ #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
+ #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option.
+ #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
#if ENABLED(VIKI2) || ENABLED(miniVIKI)
// #define LCD_SCREEN_ROT_180
@@ -307,7 +302,7 @@
#undef LCD_PINS_D5 //59 // J3-8 & AUX-2
#define DOGLCD_A0 59 // J3-8 & AUX-2
#undef LCD_PINS_D6 //63 // J5-3 & AUX-2
- #undef LCD_PINS_D7 //6 // (SERVO1) J5-1 & SERVO connector
+ #undef LCD_PINS_D7 // 6 // (SERVO1) J5-1 & SERVO connector
#define DOGLCD_SCK SCK_PIN
#define DOGLCD_MOSI MOSI_PIN
@@ -335,17 +330,17 @@
// Ethernet pins
//
#ifndef ULTIPANEL
-#define ENET_MDIO 71 // J12-4
-#define ENET_RX_ER 73 // J12-6
-#define ENET_RXD1 75 // J12-8
+ #define ENET_MDIO 71 // J12-4
+ #define ENET_RX_ER 73 // J12-6
+ #define ENET_RXD1 75 // J12-8
#endif
-#define ENET_MOC 70 // J12-3
-#define REF_CLK 72 // J12-5
-#define ENET_RXD0 74 // J12-7
-#define ENET_CRS 76 // J12-9
-#define ENET_TX_EN 77 // J12-10
-#define ENET_TXD0 78 // J12-11
-#define ENET_TXD1 79 // J12-12
+#define ENET_MOC 70 // J12-3
+#define REF_CLK 72 // J12-5
+#define ENET_RXD0 74 // J12-7
+#define ENET_CRS 76 // J12-9
+#define ENET_TX_EN 77 // J12-10
+#define ENET_TXD0 78 // J12-11
+#define ENET_TXD1 79 // J12-12
/**
* PWMS
diff --git a/frameworks/CMSIS/LPC1768/include/lpc_types.h b/frameworks/CMSIS/LPC1768/include/lpc_types.h
index 9ba3d2290b313d4ca6ada9c19bc2865f570a34c8..690f226c41bef6da1ec142df047feda980de8725 100644
--- a/frameworks/CMSIS/LPC1768/include/lpc_types.h
+++ b/frameworks/CMSIS/LPC1768/include/lpc_types.h
@@ -134,7 +134,7 @@ typedef int32_t(*PFI)();
/* NULL pointer */
#ifndef NULL
-#define NULL ((void*) 0)
+ #define NULL ((void*) 0)
#endif
/* Number of elements in an array */
@@ -145,11 +145,11 @@ typedef int32_t(*PFI)();
/* External data/function define */
#define EXTERN extern
-#if !defined(MAX)
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+#ifndef MAX
+ #define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
-#if !defined(MIN)
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#ifndef MIN
+ #define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
/**