From ff1b8b1a948b50da3dcf10c87530887045439ee8 Mon Sep 17 00:00:00 2001 From: pexcn Date: Fri, 9 Feb 2024 11:55:03 +0800 Subject: [PATCH] avoid switchRelay() frequently writing flash reference: https://github.com/qlwz/esp_dc1/issues/16#issuecomment-1367117954 --- src/DC1.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/DC1.cpp b/src/DC1.cpp index e47a1b0..ed6181c 100644 --- a/src/DC1.cpp +++ b/src/DC1.cpp @@ -561,8 +561,7 @@ void DC1::switchRelay(uint8_t ch, bool isOn, bool isSave) if (isSave && config.power_on_state > 0) { bitWrite(config.last_state, ch, isOn); - bitSet(operationFlag, 1); - Config::delaySaveConfig(10); + bitSet(operationFlag, 0); } if (ch == 0)