Skip to content

Commit

Permalink
Fix regression on M110 command (kliment#1454)
Browse files Browse the repository at this point in the history
 * Add test file for repeated prints
 * Add old behavior of M110 back and combine it with the actual behavior of Prusa firmware >3.12.x. Actual Prusa firmware >3.12.x needs "M110 N-1", Smoothieware firmware needs "N-1 M110" and old Marlin firmware 1.0.0 needs in addition line checksum. `self._send("M110 N-1", -1, True)` results in sending "N-1 M110 N-1*125" and does not harm Smoothieware and old Marlin firmware.

Fixes kliment#1421
  • Loading branch information
DivingDuck authored Oct 15, 2024
1 parent 6e005a3 commit 991fa18
Show file tree
Hide file tree
Showing 4 changed files with 486 additions and 2 deletions.
4 changes: 2 additions & 2 deletions printrun/printcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def startprint(self, gcode, startindex = 0):
return True

self.clear = False
self._send("M110 N-1")
self._send("M110 N-1", -1, True)

resuming = (startindex != 0)
self.print_thread = threading.Thread(target = self._print,
Expand Down Expand Up @@ -675,7 +675,7 @@ def _sendnext(self):
if not self.paused:
self.queueindex = 0
self.lineno = 0
self._send("M110 N-1")
self._send("M110 N-1", -1, True)

def _send(self, command, lineno = 0, calcchecksum = False):
# Only add checksums if over serial (tcp does the flow control itself)
Expand Down
21 changes: 21 additions & 0 deletions testfiles/arc_test.gcode
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; Print this file for a quick test of support for arc movements with
; G2 and G3 and z helix movement up and down +- 10 mm, 6 times a full cycle
; It takes only a half minute and prints above the print bed (z=20 mm)
; w/o heating and extrusion

G28 ; home
G0 Z10.0000 S0 ; lift z
G90 ; absolute mode
G21 ; set unit to mm

G2 X15 Y20 I30 J40 Z20 F8000
G3 X15 Y20 I30 J40 Z10 F8000
G2 X15 Y20 I30 J40 Z20 F8000
G3 X15 Y20 I30 J40 Z10 F8000
G2 X15 Y20 I30 J40 Z20 F8000
G3 X15 Y20 I30 J40 Z10 F8000

G0 X5.0000
G0 Y5.0000

M84; motors off
Loading

0 comments on commit 991fa18

Please sign in to comment.