mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-11-02 03:16:02 +01:00
toolhead: Avoid pausing an infinitesimal amount of time
Due to differences in mcu clock vs system clock it's possible to repeatedly underestimate a system delay needed to bring about a sufficient mcu time - which just wastes cpu cycles retrying a pause. It's okay to sleep a slightly longer time to avoid the issue. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -337,7 +337,8 @@ class ToolHead:
|
||||
if not self.can_pause:
|
||||
self.need_check_pause = self.reactor.NEVER
|
||||
return
|
||||
eventtime = self.reactor.pause(eventtime + min(1., pause_time))
|
||||
eventtime = self.reactor.pause(
|
||||
eventtime + max(.005, min(1., pause_time)))
|
||||
est_print_time = self.mcu.estimated_print_time(eventtime)
|
||||
buffer_time = self.print_time - est_print_time
|
||||
if not self.special_queuing_state:
|
||||
|
||||
Reference in New Issue
Block a user