mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 05:06:32 +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
|
// 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
|
if (TasmotaGlobal.rel_bistable) { // If bistable relays in the mix reset them after 40ms
|
||||||
delay(40); // About 5 x operation time
|
delay(40); // Keep energized for about 5 x operation time
|
||||||
for (uint32_t i = 0; i < MAX_RELAYS; i++) {
|
for (uint32_t i = 0; i < port; i++) { // Reset up to detected amount of ports
|
||||||
if (bitRead(TasmotaGlobal.rel_bistable, i)) {
|
if (bitRead(TasmotaGlobal.rel_bistable, i)) {
|
||||||
DigitalWrite(GPIO_REL1, i, bitRead(TasmotaGlobal.rel_inverted, i) ? 1 : 0);
|
DigitalWrite(GPIO_REL1, i, bitRead(TasmotaGlobal.rel_inverted, i) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user