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

Adding M118 command to send text to serial

Allows the user to send text to the serial console in order to
communicate with a host - sending debuging information or action
commands, for example.  Text must begin with '//' and this is added if
it is not already present at the beginning of the string.
Ben Lye преди 8 години
родител
ревизия
98d362c2da
променени са 2 файла, в които са добавени 13 реда и са изтрити 1 реда
  1. 12
    0
      Marlin/Marlin_main.cpp
  2. 1
    1
      Marlin/gcode.cpp

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

130
  * M114 - Report current position.
130
  * M114 - Report current position.
131
  * M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT)
131
  * M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT)
132
  * M117 - Display a message on the controller screen. (Requires an LCD)
132
  * M117 - Display a message on the controller screen. (Requires an LCD)
133
+ * M118 - Display a message in the host console.
133
  * M119 - Report endstops status.
134
  * M119 - Report endstops status.
134
  * M120 - Enable endstops detection.
135
  * M120 - Enable endstops detection.
135
  * M121 - Disable endstops detection.
136
  * M121 - Disable endstops detection.
7992
 inline void gcode_M117() { lcd_setstatus(parser.string_arg); }
7993
 inline void gcode_M117() { lcd_setstatus(parser.string_arg); }
7993
 
7994
 
7994
 /**
7995
 /**
7996
+ * M118: Display a message in the host console.
7997
+ */
7998
+inline void gcode_M118() {
7999
+  SERIAL_ECHO_START();
8000
+  SERIAL_ECHOLN(parser.string_arg);
8001
+}
8002
+
8003
+/**
7995
  * M119: Output endstop states to serial output
8004
  * M119: Output endstop states to serial output
7996
  */
8005
  */
7997
 inline void gcode_M119() { endstops.M119(); }
8006
 inline void gcode_M119() { endstops.M119(); }
10758
       case 117: // M117: Set LCD message text, if possible
10767
       case 117: // M117: Set LCD message text, if possible
10759
         gcode_M117();
10768
         gcode_M117();
10760
         break;
10769
         break;
10770
+      case 118: // M118: Display a message in the host console
10771
+        gcode_M118();
10772
+        break;
10761
       case 119: // M119: Report endstop states
10773
       case 119: // M119: Report endstop states
10762
         gcode_M119();
10774
         gcode_M119();
10763
         break;
10775
         break;

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

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 928: string_arg = p; return; default: break; }
153
+  if (letter == 'M') switch (codenum) { case 23: case 28: case 30: case 117: case 118: 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;

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