Skip to content

Commit

Permalink
Bool param is 1 with no value
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 12, 2022
1 parent de670b6 commit 09b7275
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Marlin/src/gcode/probe/M401_M402.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@
* M401: Deploy and activate the Z probe
*
* With BLTOUCH_HS_MODE:
* H Report the current BLTouch HS mode state
* S<bool> 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);
Expand Down

0 comments on commit 09b7275

Please sign in to comment.