From fbe7466bc8dd862ab6defc78e227210ac7b7dfbb Mon Sep 17 00:00:00 2001 From: stefanbode Date: Fri, 18 Dec 2020 09:19:45 +0100 Subject: [PATCH] #10166 fixed improved stop procedure to avoid overrun due to rounding issues between % and the real_position --- tasmota/xdrv_27_shutter.ino | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tasmota/xdrv_27_shutter.ino b/tasmota/xdrv_27_shutter.ino index 63c44b3c1..735277e32 100644 --- a/tasmota/xdrv_27_shutter.ino +++ b/tasmota/xdrv_27_shutter.ino @@ -984,15 +984,10 @@ void CmndShutterStop(void) if (Shutter[i].direction != 0) { AddLog_P(LOG_LEVEL_DEBUG, PSTR("SHT: Stop moving %d: dir: %d"), XdrvMailbox.index, Shutter[i].direction); - - int32_t temp_realpos = ShutterCalculatePosition(i); - XdrvMailbox.payload = ShutterRealToPercentPosition(temp_realpos, i)-Shutter[i].direction; - TasmotaGlobal.last_source = SRC_WEBGUI; - CmndShutterPosition(); - } else { - if (XdrvMailbox.command) - ResponseCmndDone(); - } + Shutter[i].target_position = Shutter[i].real_position; + } + if (XdrvMailbox.command) + ResponseCmndDone(); } else { if (XdrvMailbox.command) ResponseCmndIdxChar("Locked");