From 9feb05ce418a57127ac1f95f5f07e8ef4beae7f4 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 21 Jun 2019 20:46:44 -0400 Subject: mcu: Support minclock in send_with_response() requests Enhance send_with_response() so that it supports queries with a minclock. Signed-off-by: Kevin O'Connor --- klippy/clocksync.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'klippy/clocksync.py') diff --git a/klippy/clocksync.py b/klippy/clocksync.py index 5dffc215..ada09256 100644 --- a/klippy/clocksync.py +++ b/klippy/clocksync.py @@ -131,6 +131,9 @@ class ClockSync: def get_clock(self, eventtime): sample_time, clock, freq = self.clock_est return int(clock + (eventtime - sample_time) * freq) + def estimate_clock_systime(self, reqclock): + sample_time, clock, freq = self.clock_est + return float(reqclock - clock)/freq + sample_time def estimated_print_time(self, eventtime): return self.clock_to_print_time(self.get_clock(eventtime)) # misc commands -- cgit v1.2.3-70-g09d2