From 9071a9f8fd2350eb3ac1fd8ab1a66fdd7df68d44 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 15 Feb 2021 12:51:12 +0100 Subject: [PATCH] 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 ` --- Firmware/Marlin_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 316a79c51..d6602ef87 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3833,16 +3833,16 @@ void process_commands() #### Usage M0 [P] [string] - M1 [P] [S] [string] + M1 [P] [S] [string] #### Parameters - `P` - Expire time, in milliseconds - `S` - 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;