From 5e5d0d0dd7c6eb8b6eb425aad1a099828759ba2e Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Sat, 25 Jul 2020 04:25:28 +0300 Subject: [PATCH] relay: don't init RelaysMax relays when using rfbridge provider --- code/espurna/relay.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/code/espurna/relay.cpp b/code/espurna/relay.cpp index eca66fc5..ab6f1169 100644 --- a/code/espurna/relay.cpp +++ b/code/espurna/relay.cpp @@ -1473,15 +1473,13 @@ void _relaySetupAdhoc() { for (unsigned char id = 0; id < RelaysMax; ++id) { const auto pin = _relayPin(id); - #if (RELAY_PROVIDER == RELAY_PROVIDER_RELAY) || (RELAY_PROVIDER == RELAY_PROVIDER_LIGHT) - if (!gpioValid(pin)) { - break; - } - #elif (RELAY_PROVIDER == RELAY_PROVIDER_MCP23S08) + #if (RELAY_PROVIDER == RELAY_PROVIDER_MCP23S08) if (!mcpGpioValid(pin)) { + #else + if (!gpioValid(pin)) { + #endif break; } - #endif _relays.emplace_back( std::make_unique(_relayPin(id)),