Browse Source

Fix M118 parameters, with strict guideline

Scott Lahteine 7 years ago
parent
commit
e6aba99f16
2 changed files with 4 additions and 3 deletions
  1. 2
    2
      Marlin/src/gcode/host/M118.cpp
  2. 2
    1
      Marlin/src/gcode/parser.cpp

+ 2
- 2
Marlin/src/gcode/host/M118.cpp View File

25
 /**
25
 /**
26
  * M118: Display a message in the host console.
26
  * M118: Display a message in the host console.
27
  *
27
  *
28
- *  A  Append '// ' for an action command, as in OctoPrint
29
- *  E  Have the host 'echo:' the text
28
+ *  A1  Append '// ' for an action command, as in OctoPrint
29
+ *  E1  Have the host 'echo:' the text
30
  */
30
  */
31
 void GcodeSuite::M118() {
31
 void GcodeSuite::M118() {
32
   if (parser.boolval('E')) SERIAL_ECHO_START();
32
   if (parser.boolval('E')) SERIAL_ECHO_START();

+ 2
- 1
Marlin/src/gcode/parser.cpp View File

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

Loading…
Cancel
Save