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>
This commit is contained in:
Kevin O'Connor 2019-06-21 20:46:44 -04:00
parent e202a8802b
commit 9feb05ce41
3 changed files with 27 additions and 11 deletions

View file

@ -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