From 8676ca0ede874c0972aa090d400250c2a4c20571 Mon Sep 17 00:00:00 2001 From: stefanbode Date: Fri, 4 Feb 2022 09:04:03 +0100 Subject: [PATCH] #14678 added option to let direction relay execute before power on Added to new user_config.override options #define SHUTTER_RELAY_OPERATION_TIME = 100 // wait for direction relay 0.1sec before power up main relay #define MOTOR_STOP_TIME = 500 // wait 0.5 second after stop to do any other action. e.g. move in the opposite direction --- tasmota/xdrv_27_shutter.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasmota/xdrv_27_shutter.ino b/tasmota/xdrv_27_shutter.ino index b12f882af..d783ad10c 100644 --- a/tasmota/xdrv_27_shutter.ino +++ b/tasmota/xdrv_27_shutter.ino @@ -1185,8 +1185,8 @@ void CmndShutterPosition(void) } if (Shutter[index].direction != new_shutterdirection) { ShutterStartInit(index, new_shutterdirection, Shutter[index].target_position); - uint8_t save_direction = Shutter[i].direction; - Shutter[i].direction = 0; // set temporary direction = 0 to avoid RTC timer sarting. Some delay may happen before shutter starts moving + uint8_t save_direction = Shutter[index].direction; + Shutter[index].direction = 0; // set temporary direction = 0 to avoid RTC timer sarting. Some delay may happen before shutter starts moving switch (ShutterGlobal.position_mode) { case SHT_COUNTER: case SHT_PWM_TIME: @@ -1226,7 +1226,7 @@ void CmndShutterPosition(void) } // if (!ShutterGlobal.skip_relay_change) break; } // switch (ShutterGlobal.position_mode) - Shutter[i].direction = save_direction; + Shutter[index].direction = save_direction; ShutterGlobal.RelayCurrentMask = 0; } // if (Shutter[i].direction[index] != new_shutterdirection) } else {