✨ M110 Get Command Line Number (#27090)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
parent
75eee04972
commit
5561bafbe6
@ -135,6 +135,7 @@
|
|||||||
#define STR_BUSY_PAUSED_FOR_USER "busy: paused for user"
|
#define STR_BUSY_PAUSED_FOR_USER "busy: paused for user"
|
||||||
#define STR_BUSY_PAUSED_FOR_INPUT "busy: paused for input"
|
#define STR_BUSY_PAUSED_FOR_INPUT "busy: paused for input"
|
||||||
#define STR_Z_MOVE_COMP "Z_move_comp"
|
#define STR_Z_MOVE_COMP "Z_move_comp"
|
||||||
|
#define STR_LINE_NO "Line: "
|
||||||
#define STR_RESEND "Resend: "
|
#define STR_RESEND "Resend: "
|
||||||
#define STR_UNKNOWN_COMMAND "Unknown command: \""
|
#define STR_UNKNOWN_COMMAND "Unknown command: \""
|
||||||
#define STR_ACTIVE_EXTRUDER "Active Extruder: "
|
#define STR_ACTIVE_EXTRUDER "Active Extruder: "
|
||||||
|
@ -143,7 +143,7 @@
|
|||||||
* R<temp> Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. **
|
* R<temp> Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. **
|
||||||
* If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
|
* If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
|
||||||
*
|
*
|
||||||
* M110 - Set the current line number. (Used by host printing)
|
* M110 - Get or set the current line number. (Used by host printing)
|
||||||
* M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
|
* M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
|
||||||
* M112 - Full Shutdown.
|
* M112 - Full Shutdown.
|
||||||
*
|
*
|
||||||
|
@ -24,11 +24,19 @@
|
|||||||
#include "../queue.h" // for last_N
|
#include "../queue.h" // for last_N
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* M110: Set Current Line Number
|
* M110: Get or set Current Line Number
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* N<int> Number to set as last-processed command
|
||||||
|
*
|
||||||
|
* Without parameters:
|
||||||
|
* Report the last-processed (not last-received or last-enqueued) command
|
||||||
|
* (To purge the queue and resume from this line, the host should use 'M999' instead.)
|
||||||
*/
|
*/
|
||||||
void GcodeSuite::M110() {
|
void GcodeSuite::M110() {
|
||||||
|
|
||||||
if (parser.seenval('N'))
|
if (parser.seenval('N'))
|
||||||
queue.set_current_line_number(parser.value_long());
|
queue.set_current_line_number(parser.value_long());
|
||||||
|
else
|
||||||
|
SERIAL_ECHOLNPGM(STR_LINE_NO, queue.get_current_line_number());
|
||||||
}
|
}
|
||||||
|
@ -212,6 +212,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
static void set_current_line_number(long n) { serial_state[ring_buffer.command_port().index].last_N = n; }
|
static void set_current_line_number(long n) { serial_state[ring_buffer.command_port().index].last_N = n; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current line number for the last received command
|
||||||
|
*/
|
||||||
|
static long get_current_line_number() { return serial_state[ring_buffer.command_port().index].last_N; }
|
||||||
|
|
||||||
#if ENABLED(BUFFER_MONITORING)
|
#if ENABLED(BUFFER_MONITORING)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user