mcu: Set reqclock on trsync_start commands

Set the reqclock on trsync commands to ensure those commands do not
cause 32-bit timer rollover errors.  Otherwise, it may result in
"Timer too close" errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-07-09 14:34:38 -04:00
parent 28f60f7ef6
commit f24210054a
1 changed files with 3 additions and 2 deletions

View File

@ -107,10 +107,11 @@ class MCU_trsync:
self._mcu.register_response(self._handle_trsync_state, self._mcu.register_response(self._handle_trsync_state,
"trsync_state", self._oid) "trsync_state", self._oid)
self._trsync_start_cmd.send([self._oid, clock, report_ticks, self._trsync_start_cmd.send([self._oid, clock, report_ticks,
self.REASON_COMMS_TIMEOUT]) self.REASON_COMMS_TIMEOUT], reqclock=clock)
for s in self._steppers: for s in self._steppers:
self._stepper_stop_cmd.send([s.get_oid(), self._oid]) self._stepper_stop_cmd.send([s.get_oid(), self._oid])
self._trsync_set_timeout_cmd.send([self._oid, expire_clock]) self._trsync_set_timeout_cmd.send([self._oid, expire_clock],
reqclock=expire_clock)
def set_home_end_time(self, home_end_time): def set_home_end_time(self, home_end_time):
self._home_end_clock = self._mcu.print_time_to_clock(home_end_time) self._home_end_clock = self._mcu.print_time_to_clock(home_end_time)
def stop(self): def stop(self):