Skip to content

Commit

Permalink
avoid switchRelay() frequently writing flash
Browse files Browse the repository at this point in the history
  • Loading branch information
pexcn committed Feb 9, 2024
1 parent 6346213 commit ff1b8b1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/DC1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ff1b8b1

Please sign in to comment.