From c090f96a2e1c79b4a11dc44548345436cb844116 Mon Sep 17 00:00:00 2001 From: Mitch Bradley Date: Thu, 1 Jul 2021 22:37:58 -1000 Subject: [PATCH] Homing cycle 0 means not homed with home-all, but $HA would work --- Grbl_Esp32/src/Limits.cpp | 2 +- Grbl_Esp32/src/Machine/Homing.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Grbl_Esp32/src/Limits.cpp b/Grbl_Esp32/src/Limits.cpp index eb3981c4..e3699605 100644 --- a/Grbl_Esp32/src/Limits.cpp +++ b/Grbl_Esp32/src/Limits.cpp @@ -392,7 +392,7 @@ void limits_run_homing_cycles(AxisMask axis_mask) { // Run all homing cycles bool someAxisHomed = false; - for (int cycle = 0; cycle < MAX_N_AXIS; cycle++) { + for (int cycle = 1; cycle <= MAX_N_AXIS; cycle++) { // Set axis_mask to the axes that home on this cycle axis_mask = 0; auto n_axis = config->_axes->_numberAxis; diff --git a/Grbl_Esp32/src/Machine/Homing.h b/Grbl_Esp32/src/Machine/Homing.h index d0a633e0..9768bae9 100644 --- a/Grbl_Esp32/src/Machine/Homing.h +++ b/Grbl_Esp32/src/Machine/Homing.h @@ -25,6 +25,8 @@ namespace Machine { public: Homing() = default; + // The homing cycles are 1,2,3 etc. 0 means not homed as part of home-all, + // but you can still home it manually with e.g. $HA int _cycle = -1; // what homing cycle does this axis home on? bool _square = false; bool _positiveDirection = true; @@ -37,7 +39,7 @@ namespace Machine { float _locate_scaler = 1.0f; // Configuration system helpers: - void validate() const override { Assert(_cycle >= 1, "Cycle has to be defined as >= 1 for homing sequence."); } + void validate() const override { Assert(_cycle >= 0, "Homing cycle must be defined"); } void group(Configuration::HandlerBase& handler) override { handler.item("cycle", _cycle);