diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino index d15bf81e9..1841098f0 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino @@ -1383,7 +1383,8 @@ void ShutterUpdateVelocity(uint8_t i) void ShutterWaitForMotorStart(uint8_t i) { - while (millis() < Shutter[i].last_stop_time + ShutterSettings.shutter_motorstop) { + uint32_t start_time = Shutter[i].last_stop_time; + while (TimePassedSince(start_time) < ShutterSettings.shutter_motorstop && TimePassedSince(start_time) > 0) { loop(); } //AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Stoptime done")); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino index 6ad2ed327..9209516ac 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino @@ -654,7 +654,8 @@ void ShutterWaitForMotorStop(uint8_t i) void ShutterWaitForMotorStart(uint8_t i) { - while (millis() < Shutter[i].last_stop_time + Settings->shutter_motorstop) { + uint32_t start_time = Shutter[i].last_stop_time; + while (TimePassedSince(start_time) < Settings->shutter_motorstop && TimePassedSince(start_time) > 0) { loop(); } //AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Stoptime done"));