Closed ellensp closed 1 week ago
The G-code line number is somewhat arbitrary, as it isn't the line in the G-code file, but just the line of commands that have been sent, potentially with comments and other stuff stripped out. I can see this being useful for debugging, but is there some host protocol that would need to get the line number of the last command that was received and enqueued just before the M110
command?
Note that the host is most likely to have already sent additional complete enqueued commands and command bytes that are yet to be enqueued at the time when the M110
(sent as a user command) processed in the queue. (Note that M110
is not a super-command like M112
and is processed in the regular queue order).
Tweaked this to make it a real "protocol" feature, and added a note to remind us that this is related to M999
.
Don't forget to update the M110 - Set Line Number page 😃
Description
While looking around at how marlin handles gcode with line numbers and checksum I noticed there was no way to see the current line number.
M110 N#### sets the line number, but M110 on its own does nothing This PR changes M110 on its own to emit the current line number
eg send: M110 receive: echo: M110 N0
This adds a whole 6 bytes flash on Avr based machines, so I concluded that having a define to remove this new feature was probably not needed.
Requirements
None
Benefits
More constant gcode behavior (gcode without parameters tend to return the current settings for that gcode)