Przeglądaj źródła

Fix M118 parameters, with strict guideline

Scott Lahteine 7 lat temu
rodzic
commit
30e4b85587
2 zmienionych plików z 4 dodań i 3 usunięć
  1. 2
    2
      Marlin/Marlin_main.cpp
  2. 2
    1
      Marlin/gcode.cpp

+ 2
- 2
Marlin/Marlin_main.cpp Wyświetl plik

8705
 /**
8705
 /**
8706
  * M118: Display a message in the host console.
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
 inline void gcode_M118() {
8711
 inline void gcode_M118() {
8712
   if (parser.boolval('E')) SERIAL_ECHO_START();
8712
   if (parser.boolval('E')) SERIAL_ECHO_START();

+ 2
- 1
Marlin/gcode.cpp Wyświetl plik

150
   #endif
150
   #endif
151
 
151
 
152
   // Only use string_arg for these M codes
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
   #if ENABLED(DEBUG_GCODE_PARSER)
155
   #if ENABLED(DEBUG_GCODE_PARSER)
156
     const bool debug = codenum == 800;
156
     const bool debug = codenum == 800;
162
    * Most codes ignore 'string_arg', but those that want a string will get the right pointer.
162
    * Most codes ignore 'string_arg', but those that want a string will get the right pointer.
163
    * The following loop assigns the first "parameter" having no numeric value to 'string_arg'.
163
    * The following loop assigns the first "parameter" having no numeric value to 'string_arg'.
164
    * This allows M0/M1 with expire time to work: "M0 S5 You Win!"
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
   string_arg = NULL;
167
   string_arg = NULL;
167
   while (char code = *p++) {                    // Get the next parameter. A NUL ends the loop
168
   while (char code = *p++) {                    // Get the next parameter. A NUL ends the loop

Ładowanie…
Anuluj
Zapisz