Browse Source

🚸 M401 H - Report BLTouch HS State (#23724)

kisslorand 3 years ago
parent
commit
0563626286
No account linked to committer's email address
1 changed files with 8 additions and 2 deletions
  1. 8
    2
      Marlin/src/gcode/probe/M401_M402.cpp

+ 8
- 2
Marlin/src/gcode/probe/M401_M402.cpp View File

36
  * M401: Deploy and activate the Z probe
36
  * M401: Deploy and activate the Z probe
37
  *
37
  *
38
  * With BLTOUCH_HS_MODE:
38
  * With BLTOUCH_HS_MODE:
39
+ *  H       Report the current BLTouch HS mode state and exit
39
  *  S<bool> Set High Speed (HS) Mode and exit without deploy
40
  *  S<bool> Set High Speed (HS) Mode and exit without deploy
40
  */
41
  */
41
 void GcodeSuite::M401() {
42
 void GcodeSuite::M401() {
42
-  if (parser.seen('S')) {
43
+  const bool seenH = parser.seen_test('H'),
44
+             seenS = parser.seen('S');
45
+  if (seenH || seenS) {
43
     #ifdef BLTOUCH_HS_MODE
46
     #ifdef BLTOUCH_HS_MODE
44
-      bltouch.high_speed_mode = parser.value_bool();
47
+      if (seenS) bltouch.high_speed_mode = parser.value_bool();
48
+      SERIAL_ECHO_START();
49
+      SERIAL_ECHOPGM("BLTouch HS mode ");
50
+      serialprintln_onoff(bltouch.high_speed_mode);
45
     #endif
51
     #endif
46
   }
52
   }
47
   else {
53
   else {

Loading…
Cancel
Save