diff --git a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino index 95ca9f763..7b6e4ae72 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_esp32_shutter.ino @@ -1383,8 +1383,7 @@ void ShutterUpdateVelocity(uint8_t i) void ShutterWaitForMotorStart(uint8_t i) { - uint32_t end_time = Shutter[i].last_stop_time + ShutterSettings.shutter_motorstop; - while (!TimeReached(end_time)) { + while (millis() - Shutter[i].last_stop_time < ShutterSettings.shutter_motorstop) { // statement is overflow proof 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 69153ab54..89c7d91c9 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_27_shutter.ino @@ -656,8 +656,7 @@ void ShutterWaitForMotorStop(uint8_t i) void ShutterWaitForMotorStart(uint8_t i) { - uint32_t end_time = Shutter[i].last_stop_time + Settings->shutter_motorstop; - while (!TimeReached(end_time)) { + while (millis() - Shutter[i].last_stop_time < Settings->shutter_motorstop) { // statement is overflow proof loop(); } //AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Stoptime done"));