2 Commits

Author SHA1 Message Date
Kozmotronik
f72fe6b1f0 Merge pull request 'Fix movement transition issue.' (#12) from movement-transition-patch into dev
Reviewed-on: https://kozmotronik.nohost.me/gitea/KozmotronikTech/relay_chn/pulls/12
2025-02-22 09:01:06 +03:00
Kozmotronik
e54e28020c Fix movement transition issue.
When transitioning the movements directly the channel should be stopped first.
2025-02-22 08:48:22 +03:00

View File

@@ -588,6 +588,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