From e54e28020cab0770e60abc5b6c20905f1b4274c4 Mon Sep 17 00:00:00 2001 From: Kozmotronik Date: Sat, 22 Feb 2025 08:48:22 +0300 Subject: [PATCH] Fix movement transition issue. When transitioning the movements directly the channel should be stopped first. --- src/relay_chn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/relay_chn.c b/src/relay_chn.c index fe2f652..87a9e14 100644 --- a/src/relay_chn.c +++ b/src/relay_chn.c @@ -582,11 +582,14 @@ static void relay_chn_issue_cmd(relay_chn_t* relay_chn, relay_chn_cmd_t cmd) relay_chn_dispatch_cmd(relay_chn, cmd); return; } - + if (relay_chn->run_info.last_run_cmd == cmd) { // If the last run command is the same as the current command, do nothing 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; -- 2.39.5