From ae33204a87cdc55d230ac540ac65855468d01c82 Mon Sep 17 00:00:00 2001 From: ismail Date: Wed, 27 Aug 2025 11:03:55 +0300 Subject: [PATCH] Optimize internal stop calls for output errors --- src/relay_chn_tilt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/relay_chn_tilt.c b/src/relay_chn_tilt.c index fdc732f..f07e36f 100644 --- a/src/relay_chn_tilt.c +++ b/src/relay_chn_tilt.c @@ -516,7 +516,7 @@ static void relay_chn_tilt_execute_forward(relay_chn_tilt_ctl_t *tilt_ctl) if (relay_chn_output_reverse(tilt_ctl->chn_ctl->output) != ESP_OK) { ESP_LOGE(TAG, "relay_chn_tilt_execute_forward: Failed to output reverse for relay channel #%d!", tilt_ctl->chn_ctl->id); // Stop tilting because of the error - relay_chn_tilt_dispatch_cmd(tilt_ctl, RELAY_CHN_TILT_CMD_STOP); + relay_chn_tilt_execute_stop(tilt_ctl); return; } // Set the move time timer @@ -530,7 +530,7 @@ static void relay_chn_tilt_execute_reverse(relay_chn_tilt_ctl_t *tilt_ctl) if (relay_chn_output_forward(tilt_ctl->chn_ctl->output) != ESP_OK) { ESP_LOGE(TAG, "relay_chn_tilt_execute_reverse: Failed to output forward for relay channel #%d!", tilt_ctl->chn_ctl->id); // Stop tilting because of the error - relay_chn_tilt_dispatch_cmd(tilt_ctl, RELAY_CHN_TILT_CMD_STOP); + relay_chn_tilt_execute_stop(tilt_ctl); return; } // Set the move time timer @@ -545,7 +545,7 @@ static void relay_chn_tilt_execute_pause(relay_chn_tilt_ctl_t *tilt_ctl) if (relay_chn_output_stop(tilt_ctl->chn_ctl->output) != ESP_OK) { ESP_LOGE(TAG, "relay_chn_tilt_execute_pause: Failed to output stop for relay channel #%d!", tilt_ctl->chn_ctl->id); // Stop tilting because of the error - relay_chn_tilt_dispatch_cmd(tilt_ctl, RELAY_CHN_TILT_CMD_STOP); + relay_chn_tilt_execute_stop(tilt_ctl); return; } @@ -553,7 +553,7 @@ static void relay_chn_tilt_execute_pause(relay_chn_tilt_ctl_t *tilt_ctl) if (relay_chn_tilt_count_update(tilt_ctl) == 0) { ESP_LOGD(TAG, "relay_chn_tilt_execute_pause: Relay channel cannot tilt anymore"); // Stop tilting since the tilting limit has been reached - relay_chn_tilt_dispatch_cmd(tilt_ctl, RELAY_CHN_TILT_CMD_STOP); + relay_chn_tilt_execute_stop(tilt_ctl); return; }