Преглед на файлове

Fix M118 parameters, with strict guideline

Scott Lahteine преди 6 години
родител
ревизия
30e4b85587
променени са 2 файла, в които са добавени 4 реда и са изтрити 3 реда
  1. 2
    2
      Marlin/Marlin_main.cpp
  2. 2
    1
      Marlin/gcode.cpp

+ 2
- 2
Marlin/Marlin_main.cpp Целия файл

@@ -8705,8 +8705,8 @@ inline void gcode_M117() { lcd_setstatus(parser.string_arg); }
8705 8705
 /**
8706 8706
  * M118: Display a message in the host console.
8707 8707
  *
8708
- *  A  Append '// ' for an action command, as in OctoPrint
8709
- *  E  Have the host 'echo:' the text
8708
+ *  A1  Append '// ' for an action command, as in OctoPrint
8709
+ *  E1  Have the host 'echo:' the text
8710 8710
  */
8711 8711
 inline void gcode_M118() {
8712 8712
   if (parser.boolval('E')) SERIAL_ECHO_START();

+ 2
- 1
Marlin/gcode.cpp Целия файл

@@ -150,7 +150,7 @@ void GCodeParser::parse(char *p) {
150 150
   #endif
151 151
 
152 152
   // Only use string_arg for these M codes
153
-  if (letter == 'M') switch (codenum) { case 23: case 28: case 30: case 117: case 118: case 928: string_arg = p; return; default: break; }
153
+  if (letter == 'M') switch (codenum) { case 23: case 28: case 30: case 117: case 928: string_arg = p; return; default: break; }
154 154
 
155 155
   #if ENABLED(DEBUG_GCODE_PARSER)
156 156
     const bool debug = codenum == 800;
@@ -162,6 +162,7 @@ void GCodeParser::parse(char *p) {
162 162
    * Most codes ignore 'string_arg', but those that want a string will get the right pointer.
163 163
    * The following loop assigns the first "parameter" having no numeric value to 'string_arg'.
164 164
    * This allows M0/M1 with expire time to work: "M0 S5 You Win!"
165
+   * For 'M118' you must use 'E1' and 'A1' rather than just 'E' or 'A'
165 166
    */
166 167
   string_arg = NULL;
167 168
   while (char code = *p++) {                    // Get the next parameter. A NUL ends the loop

Loading…
Отказ
Запис