optimize switch off time

Detailed analysis of where time is used during stop and optimize stop.
This commit is contained in:
stefanbode 2020-12-15 12:40:47 +01:00 committed by GitHub
parent 742929f68e
commit 3487c4969a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -616,7 +616,7 @@ void ShutterRelayChanged(void)
break;
default:
TasmotaGlobal.last_source = SRC_SHUTTER; // avoid switch off in the next loop
if (Shutter[i].direction != 0 ) ShutterUpdatePosition();
if (Shutter[i].direction != 0 ) Shutter[i].target_position = Shutter[i].real_position;
}
switch (ShutterGlobal.position_mode) {
// enum Shutterposition_mode {SHT_TIME, SHT_TIME_UP_DOWN, SHT_TIME_GARAGE, SHT_COUNTER, SHT_PWM_VALUE, SHT_PWM_TIME,};
@ -983,7 +983,7 @@ void CmndShutterStop(void)
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);
XdrvMailbox.payload = ShutterRealToPercentPosition(temp_realpos, i)-Shutter[i].direction;
TasmotaGlobal.last_source = SRC_WEBGUI;
CmndShutterPosition();
} else {