From 5ef1ec5d0d0fc5dad444a80e96a032a5c3487478 Mon Sep 17 00:00:00 2001 From: stefanbode Date: Sun, 5 Sep 2021 22:07:50 +0200 Subject: [PATCH] Update xdrv_27_shutter.ino #12849 Additional side effect correction --- tasmota/xdrv_27_shutter.ino | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasmota/xdrv_27_shutter.ino b/tasmota/xdrv_27_shutter.ino index 3431cb7d8..ecac96197 100644 --- a/tasmota/xdrv_27_shutter.ino +++ b/tasmota/xdrv_27_shutter.ino @@ -431,7 +431,7 @@ void ShutterDecellerateForStop(uint8_t i) //prepare for stop PWM Shutter[i].accelerator = 0; Shutter[i].pwm_velocity = 0; - while (RtcSettings.pulse_counter[i] < (uint32_t)(Shutter[i].target_position-Shutter[i].start_position)*Shutter[i].direction*ShutterGlobal.open_velocity_max/RESOLUTION/STEPS_PER_SECOND) { + while (RtcSettings.pulse_counter[i] < (uint32_t)(Shutter[i].target_position-Shutter[i].start_position)*Shutter[i].direction*ShutterGlobal.open_velocity_max/RESOLUTION/STEPS_PER_SECOND && missing_steps > 0) { } analogWrite(Pin(GPIO_PWM1, i), 0); // removed with 8.3 because of reset caused by watchog Shutter[i].real_position = ShutterCalculatePosition(i); @@ -1084,7 +1084,6 @@ void CmndShutterPosition(void) } int8_t new_shutterdirection = Shutter[index].real_position < Shutter[index].target_position ? 1 : -1; if (Shutter[index].direction == -new_shutterdirection) { - Shutter[index].target_position = Shutter[index].start_position; ShutterPowerOff(index); } if (Shutter[index].direction != new_shutterdirection) {