mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 11:16:34 +00:00
Reset bistable relays up to detected amount of ports
This commit is contained in:
parent
571a2afce5
commit
7bc67f8d18
@ -318,8 +318,8 @@ void SetDevicePower(power_t rpower, uint32_t source) {
|
||||
|
||||
// Reset bistable relay here to fix non-interlock situations due to fast switching
|
||||
if (TasmotaGlobal.rel_bistable) { // If bistable relays in the mix reset them after 40ms
|
||||
delay(40); // About 5 x operation time
|
||||
for (uint32_t i = 0; i < MAX_RELAYS; i++) {
|
||||
delay(40); // Keep energized for about 5 x operation time
|
||||
for (uint32_t i = 0; i < port; i++) { // Reset up to detected amount of ports
|
||||
if (bitRead(TasmotaGlobal.rel_bistable, i)) {
|
||||
DigitalWrite(GPIO_REL1, i, bitRead(TasmotaGlobal.rel_inverted, i) ? 1 : 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user