File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 143
143
* R<temp> Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. **
144
144
* If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
145
145
*
146
- * M110 - Set the current line number. (Used by host printing)
146
+ * M110 - Get or set the current line number. (Used by host printing)
147
147
* M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
148
148
* M112 - Full Shutdown.
149
149
*
Original file line number Diff line number Diff line change 24
24
#include " ../queue.h" // for last_N
25
25
26
26
/* *
27
- * M110: Set Current Line Number
27
+ * M110: Get or set Current Line Number
28
28
*/
29
29
void GcodeSuite::M110 () {
30
30
31
31
if (parser.seenval (' N' ))
32
32
queue.set_current_line_number (parser.value_long ());
33
-
33
+ else
34
+ SERIAL_ECHO_MSG (" M110 N" , queue.get_current_line_number ());
34
35
}
Original file line number Diff line number Diff line change @@ -212,6 +212,11 @@ class GCodeQueue {
212
212
*/
213
213
static void set_current_line_number (long n) { serial_state[ring_buffer.command_port ().index ].last_N = n; }
214
214
215
+ /* *
216
+ * Get the current line number for the last received command
217
+ */
218
+ static long get_current_line_number () { return serial_state[ring_buffer.command_port ().index ].last_N ; }
219
+
215
220
#if ENABLED(BUFFER_MONITORING)
216
221
217
222
private:
You can’t perform that action at this time.
0 commit comments