Browse Source

Gcode `M1` must have a string while `M0` it is optional
As the `M0/M1` moved to the beginning of the parser
- parser would not be able to "find" `M1nn` command if the query was `M1` instead of `M1 `
- to be able to "stop/halt" without sending a string and display default message use gcode `M0`
- as there are no `M0nn` gcodes the parser can query `M0` without additional space needed as in `M1 `

3d-gussner 3 years ago
parent
commit
9071a9f8fd
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Firmware/Marlin_main.cpp

+ 3 - 3
Firmware/Marlin_main.cpp

@@ -3833,16 +3833,16 @@ void process_commands()
   #### Usage
 
       M0 [P<ms<] [S<sec>] [string]
-      M1 [P<ms>] [S<sec>] [string]
+      M1 [P<ms>] [S<sec>] [string] 
 
   #### Parameters
   
     - `P<ms>`  - Expire time, in milliseconds
     - `S<sec>` - Expire time, in seconds
-    - `string` - An optional message to display on the LCD
+    - `string` - Must for M1 and optional for M0 message to display on the LCD
     */
 
-  else if (code_seen_P(PSTR("M0 ")) || code_seen_P(PSTR("M1 "))) { // M0 and M1 - (Un)conditional stop - Wait for user button press on LCD
+  else if (code_seen_P(PSTR("M0")) || code_seen_P(PSTR("M1 "))) { // M0 and M1 - (Un)conditional stop - Wait for user button press on LCD
 
       char *src = strchr_pointer + 2;