Issue#22535 applying masking window to any power change (#22539)

* apply masking to any power change

* stupid typo

* rephrase
This commit is contained in:
Barbudor 2024-11-25 10:56:35 +01:00 committed by GitHub
parent 3ab87273e6
commit 155dea98cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -105,6 +105,12 @@ void MagicSwitchLoop()
}
}
void MagicSwitchSetPower(void) {
// It can happen that on relay switch, disturbances on the mains is falsy see as a MagicSwitch pulse
// This restart the masking windows on every power change to avoid that effect
MagicSwitch->switch_state = MAGICSWITCH_MASKING_WINDOW_LEN;
}
/********************************************************************************************************
* Driver initialisation
*/
@ -173,6 +179,9 @@ bool Xdrv71(uint32_t function) {
//case FUNC_EVERY_250_MSECOND:
MagicSwitchLoop();
break;
case FUNC_SET_POWER:
MagicSwitchSetPower();
break;
case FUNC_ADD_SWITCH:
result = MagicSwitchAddSwitch();
break;