File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 135
135
#define STR_BUSY_PAUSED_FOR_USER "busy: paused for user"
136
136
#define STR_BUSY_PAUSED_FOR_INPUT "busy: paused for input"
137
137
#define STR_Z_MOVE_COMP "Z_move_comp"
138
+ #define STR_LINE_NO "Line: "
138
139
#define STR_RESEND "Resend: "
139
140
#define STR_UNKNOWN_COMMAND "Unknown command: \""
140
141
#define STR_ACTIVE_EXTRUDER "Active Extruder: "
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
+ *
29
+ * Parameters:
30
+ * N<int> Number to set as last-processed command
31
+ *
32
+ * Without parameters:
33
+ * Report the last-processed (not last-received or last-enqueued) command
34
+ * (To purge the queue and resume from this line, the host should use 'M999' instead.)
28
35
*/
29
36
void GcodeSuite::M110 () {
30
37
31
38
if (parser.seenval (' N' ))
32
39
queue.set_current_line_number (parser.value_long ());
33
-
40
+ else
41
+ SERIAL_ECHOLNPGM (STR_LINE_NO, queue.get_current_line_number ());
34
42
}
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