Skip to content

Commit

Permalink
Add old behavior of M110 back and combine it with the actual behavior…
Browse files Browse the repository at this point in the history
… of Prusa firmware >3.12.x
  • Loading branch information
DivingDuck committed Sep 12, 2024
1 parent 710d2d3 commit e04d6ea
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions printrun/printcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,17 @@ def startprint(self, gcode, startindex = 0):
return True

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

'''Reset Gcode line number for printer
Actual Prusa firmware >3.12.x needs "M110 N-1"
Smoothieware firmware needs "N-1 M110"
Old Marlin firmware 1.0.0 needs in addition line checksum
self._send("M110 N-1", -1, True) work for Smoothieware and old Marlin firmware.
Test for Prusa is needed
'''
#self._send("M110 N-1") #Prusa firmware >3.12.x
self._send("M110 N-1", -1, True) #all in one if Prusa works with "N-1 M110 N-1 + checksum"
#self._send("M110", -1, True) #older or other firmware, like Smoothieware + Marlin 1.0 needs checksum in addition

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

'''Reset Gcode Line number for Printer
Actual Prusa firmware >3.12.x needs "M110 N-1"
Smoothieware firmware needs "N-1 M110"
Old Marlin firmware 1.0.0 needs in addition line checksum
self._send("M110 N-1", -1, True) work for Smoothieware and old Marlin firmware.
Test for Prusa is needed
'''
#self._send("M110 N-1") #Prusa firmware >3.12.x
self._send("M110 N-1", -1, True) #all in one if Prusa works with "N-1 M110 N-1 + checksum"
#self._send("M110", -1, True) #older or other firmware, like Smoothieware + Marlin 1.0 needs checksum in addition

def _send(self, command, lineno = 0, calcchecksum = False):
# Only add checksums if over serial (tcp does the flow control itself)
Expand Down

0 comments on commit e04d6ea

Please sign in to comment.