Fix tilting opposite direction when running

Fixed TILT_STOP command issuing chain that was causing a running channel
to be stopped when an opposite direction tilting requested. For exeample:
RUN_FORWARD > TILT_REVERSE. Refs #1105 and fixes #1110.
This commit is contained in:
2025-09-09 17:50:02 +03:00
parent 3ce079c2e8
commit 31e351a129

View File

@@ -140,11 +140,11 @@ static void relay_chn_tilt_issue_cmd(relay_chn_tilt_ctl_t *tilt_ctl, relay_chn_t
{
// TILT_STOP is safe and high priority
if (cmd == RELAY_CHN_TILT_CMD_STOP) {
if (tilt_ctl->chn_ctl->state == RELAY_CHN_STATE_STOPPED) {
return; // Do nothing if already stopped
relay_chn_state_t state = tilt_ctl->chn_ctl->state;
if (state == RELAY_CHN_STATE_TILT_FORWARD || state == RELAY_CHN_STATE_TILT_REVERSE) {
// If the command is TILT_STOP, issue it immediately
relay_chn_tilt_dispatch_cmd(tilt_ctl, cmd);
}
// If the command is TILT_STOP, issue it immediately
relay_chn_tilt_dispatch_cmd(tilt_ctl, cmd);
return;
}
@@ -320,7 +320,7 @@ void relay_chn_tilt_reverse()
void relay_chn_tilt_stop()
{
relay_chn_tilt_dispatch_cmd(&s_tilt_ctl, RELAY_CHN_TILT_CMD_STOP);
relay_chn_tilt_issue_cmd(&s_tilt_ctl, RELAY_CHN_TILT_CMD_STOP);
}
#endif // CONFIG_RELAY_CHN_COUNT > 1