diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-06-21 20:46:44 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-06-21 21:42:20 -0400 |
commit | 9feb05ce418a57127ac1f95f5f07e8ef4beae7f4 (patch) | |
tree | 2dfab2f92e5b8be8600973793b2c388dcd20ce34 /klippy/clocksync.py | |
parent | e202a8802b31495622a47178459481540f314b7c (diff) | |
download | kutter-9feb05ce418a57127ac1f95f5f07e8ef4beae7f4.tar.gz kutter-9feb05ce418a57127ac1f95f5f07e8ef4beae7f4.tar.xz kutter-9feb05ce418a57127ac1f95f5f07e8ef4beae7f4.zip |
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 <kevin@koconnor.net>
Diffstat (limited to 'klippy/clocksync.py')
-rw-r--r-- | klippy/clocksync.py | 3 |
1 files changed, 3 insertions, 0 deletions
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 |