From 09b72757bbb5d565ace88b33275bc67474163eeb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 11 Mar 2022 18:03:20 -0600 Subject: [PATCH] Bool param is 1 with no value --- Marlin/src/gcode/probe/M401_M402.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Marlin/src/gcode/probe/M401_M402.cpp b/Marlin/src/gcode/probe/M401_M402.cpp index 7ca4757e7995c..9f45994830438 100644 --- a/Marlin/src/gcode/probe/M401_M402.cpp +++ b/Marlin/src/gcode/probe/M401_M402.cpp @@ -36,14 +36,15 @@ * M401: Deploy and activate the Z probe * * With BLTOUCH_HS_MODE: + * H Report the current BLTouch HS mode state * S Set High Speed (HS) Mode and exit without deploy */ void GcodeSuite::M401() { - if (parser.seen('S')) { + const bool seenH = parser.seen_test('H'), + seenS = parser.seen('S'); + if (seenH || seenS) { #ifdef BLTOUCH_HS_MODE - if (parser.has_value()) { // if no value after "S" than just query - bltouch.high_speed_mode = parser.value_bool(); - } + if (seenS) bltouch.high_speed_mode = parser.value_bool(); SERIAL_ECHO_START(); SERIAL_ECHOPGM("BLTouch HS mode "); serialprintln_onoff(bltouch.high_speed_mode);