mirror of https://github.com/arendst/Tasmota.git
#10166 fixed
improved stop procedure to avoid overrun due to rounding issues between % and the real_position
This commit is contained in:
parent
e2ec826dec
commit
fbe7466bc8
|
@ -984,15 +984,10 @@ void CmndShutterStop(void)
|
||||||
if (Shutter[i].direction != 0) {
|
if (Shutter[i].direction != 0) {
|
||||||
|
|
||||||
AddLog_P(LOG_LEVEL_DEBUG, PSTR("SHT: Stop moving %d: dir: %d"), XdrvMailbox.index, Shutter[i].direction);
|
AddLog_P(LOG_LEVEL_DEBUG, PSTR("SHT: Stop moving %d: dir: %d"), XdrvMailbox.index, Shutter[i].direction);
|
||||||
|
Shutter[i].target_position = Shutter[i].real_position;
|
||||||
int32_t temp_realpos = ShutterCalculatePosition(i);
|
}
|
||||||
XdrvMailbox.payload = ShutterRealToPercentPosition(temp_realpos, i)-Shutter[i].direction;
|
if (XdrvMailbox.command)
|
||||||
TasmotaGlobal.last_source = SRC_WEBGUI;
|
ResponseCmndDone();
|
||||||
CmndShutterPosition();
|
|
||||||
} else {
|
|
||||||
if (XdrvMailbox.command)
|
|
||||||
ResponseCmndDone();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (XdrvMailbox.command)
|
if (XdrvMailbox.command)
|
||||||
ResponseCmndIdxChar("Locked");
|
ResponseCmndIdxChar("Locked");
|
||||||
|
|
Loading…
Reference in New Issue