mcu: Increase trsync_state reporting during multi-mcu homing

The current code has the mcu report a trsync_state message every 10ms
and expects a time extension within 25ms.  However, this means that if
a single mcu->host report is lost then 20ms would elapse until the
next report, which would allow for only a 5ms round-trip time before a
timeout error is reported.

Increase the trsync_state timing so that a message is sent every
7.5ms.  This increases the total number of messages per second sent
from mcu to host to 133 (from 100).  With this change, a single lost
message would still allow for up to a 10ms round-trip time.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2024-01-02 20:20:55 -05:00
parent dab39c02cd
commit 1ea9f3aa35
1 changed files with 2 additions and 2 deletions

View File

@ -192,9 +192,9 @@ class MCU_trsync:
clock = self._mcu.print_time_to_clock(print_time) clock = self._mcu.print_time_to_clock(print_time)
expire_ticks = self._mcu.seconds_to_clock(expire_timeout) expire_ticks = self._mcu.seconds_to_clock(expire_timeout)
expire_clock = clock + expire_ticks expire_clock = clock + expire_ticks
report_ticks = self._mcu.seconds_to_clock(expire_timeout * .4) report_ticks = self._mcu.seconds_to_clock(expire_timeout * .3)
report_clock = clock + int(report_ticks * report_offset + .5) report_clock = clock + int(report_ticks * report_offset + .5)
min_extend_ticks = self._mcu.seconds_to_clock(expire_timeout * .4 * .8) min_extend_ticks = int(report_ticks * .8 + .5)
ffi_main, ffi_lib = chelper.get_ffi() ffi_main, ffi_lib = chelper.get_ffi()
ffi_lib.trdispatch_mcu_setup(self._trdispatch_mcu, clock, expire_clock, ffi_lib.trdispatch_mcu_setup(self._trdispatch_mcu, clock, expire_clock,
expire_ticks, min_extend_ticks) expire_ticks, min_extend_ticks)