2 Commits

Author SHA1 Message Date
Kozmotronik
a06f58f42b Merge pull request 'hotfix-v0.1.0' (#8) from hotfix-v0.1.0 into v0.1
Reviewed-on: https://kozmotronik.nohost.me/gitea/KozmotronikTech/relay_chn/pulls/8
2025-02-21 17:55:55 +03:00
349868a148 Fix movement transition issue.
When transitioning the movements directly the channel should be stopped first.
2025-02-21 17:52:19 +03:00

View File

@@ -484,11 +484,14 @@ static void relay_chn_issue_cmd(relay_chn_t* relay_chn, relay_chn_cmd_t cmd)
relay_chn_dispatch_cmd(relay_chn, cmd); relay_chn_dispatch_cmd(relay_chn, cmd);
return; return;
} }
if (relay_chn->run_info.last_run_cmd == cmd) { if (relay_chn->run_info.last_run_cmd == cmd) {
// If the last run command is the same as the current command, do nothing // If the last run command is the same as the current command, do nothing
return; 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 // If the last run command is different from the current command, wait for the opposite inertia time
relay_chn->pending_cmd = cmd; relay_chn->pending_cmd = cmd;