Fix movement transition issue.

When transitioning the movements directly the channel should be stopped first.
This commit is contained in:
2025-02-21 17:52:19 +03:00
parent 102918fdc3
commit 349868a148

View File

@@ -490,6 +490,9 @@ static void relay_chn_issue_cmd(relay_chn_t* relay_chn, relay_chn_cmd_t cmd)
return;
}
// Stop the channel first before the schedule
relay_chn_dispatch_cmd(relay_chn, RELAY_CHN_CMD_STOP);
// If the last run command is different from the current command, wait for the opposite inertia time
relay_chn->pending_cmd = cmd;
relay_chn_state_t new_state = cmd == RELAY_CHN_CMD_FORWARD