mcu: Add support for commands to send only on a host restart

Add a new "on_restart" parameter to mcu.add_config_cmd() and only send
those commands on a host restart that does not involve a
micro-controller restart.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2020-07-19 12:26:31 -04:00
parent 4a35d7e8bd
commit d204cc1fb7
2 changed files with 14 additions and 9 deletions

View File

@@ -76,8 +76,8 @@ class MCU_stepper:
self._oid, self._step_pin, self._dir_pin,
self._mcu.seconds_to_clock(min_stop_interval),
self._invert_step))
self._mcu.add_config_cmd(
"reset_step_clock oid=%d clock=0" % (self._oid,), is_init=True)
self._mcu.add_config_cmd("reset_step_clock oid=%d clock=0"
% (self._oid,), on_restart=True)
step_cmd_id = self._mcu.lookup_command_id(
"queue_step oid=%c interval=%u count=%hu add=%hi")
dir_cmd_id = self._mcu.lookup_command_id(