|
@ -132,33 +132,41 @@ |
|
|
*/ |
|
|
*/ |
|
|
void GcodeSuite::G29() { |
|
|
void GcodeSuite::G29() { |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(PROBE_MANUALLY) |
|
|
|
|
|
const bool seenQ = parser.seen('Q'); |
|
|
|
|
|
#else |
|
|
|
|
|
constexpr bool seenQ = false; |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// G29 Q is also available if debugging
|
|
|
// G29 Q is also available if debugging
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) |
|
|
const bool query = parser.seen('Q'); |
|
|
|
|
|
const uint8_t old_debug_flags = marlin_debug_flags; |
|
|
const uint8_t old_debug_flags = marlin_debug_flags; |
|
|
if (query) marlin_debug_flags |= DEBUG_LEVELING; |
|
|
if (seenQ) marlin_debug_flags |= DEBUG_LEVELING; |
|
|
if (DEBUGGING(LEVELING)) { |
|
|
if (DEBUGGING(LEVELING)) { |
|
|
DEBUG_POS(">>> G29", current_position); |
|
|
DEBUG_POS(">>> G29", current_position); |
|
|
log_machine_info(); |
|
|
log_machine_info(); |
|
|
} |
|
|
} |
|
|
marlin_debug_flags = old_debug_flags; |
|
|
marlin_debug_flags = old_debug_flags; |
|
|
#if DISABLED(PROBE_MANUALLY) |
|
|
#if DISABLED(PROBE_MANUALLY) |
|
|
if (query) return; |
|
|
if (seenQ) return; |
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#if ENABLED(PROBE_MANUALLY) |
|
|
#if ENABLED(PROBE_MANUALLY) |
|
|
const bool seenA = parser.seen('A'), seenQ = parser.seen('Q'), no_action = seenA || seenQ; |
|
|
const bool seenA = parser.seen('A'); |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) |
|
|
|
|
|
const bool faux = parser.boolval('C'); |
|
|
|
|
|
#elif ENABLED(PROBE_MANUALLY) |
|
|
|
|
|
const bool faux = no_action; |
|
|
|
|
|
#else |
|
|
#else |
|
|
bool constexpr faux = false; |
|
|
constexpr bool seenA = false; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
const bool no_action = seenA || seenQ, |
|
|
|
|
|
faux = |
|
|
|
|
|
#if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) |
|
|
|
|
|
parser.boolval('C') |
|
|
|
|
|
#else |
|
|
|
|
|
no_action |
|
|
|
|
|
#endif |
|
|
|
|
|
; |
|
|
|
|
|
|
|
|
// Don't allow auto-leveling without homing first
|
|
|
// Don't allow auto-leveling without homing first
|
|
|
if (axis_unhomed_error()) return; |
|
|
if (axis_unhomed_error()) return; |
|
|
|
|
|
|
|
@ -388,7 +396,7 @@ void GcodeSuite::G29() { |
|
|
|
|
|
|
|
|
// Disable auto bed leveling during G29.
|
|
|
// Disable auto bed leveling during G29.
|
|
|
// Be formal so G29 can be done successively without G28.
|
|
|
// Be formal so G29 can be done successively without G28.
|
|
|
set_bed_leveling_enabled(false); |
|
|
if (!no_action) set_bed_leveling_enabled(false); |
|
|
|
|
|
|
|
|
#if HAS_BED_PROBE |
|
|
#if HAS_BED_PROBE |
|
|
// Deploy the probe. Probe will raise if needed.
|
|
|
// Deploy the probe. Probe will raise if needed.
|
|
|