diff --git a/code/espurna/ifan.cpp b/code/espurna/ifan.cpp index 24575be0..cf75065f 100644 --- a/code/espurna/ifan.cpp +++ b/code/espurna/ifan.cpp @@ -342,10 +342,11 @@ void setup() { auto relay_pin = gpioRegister(controlPin()); if (relay_pin) { + relay_pin->pinMode(OUTPUT); auto provider = std::make_unique(std::move(relay_pin), config, onSpeedUpdate); if (!relayAdd(std::move(provider))) { - DEBUG_MSG_P(PSTR("[IFAN] Could not add relay provider for GPIO%d\n"), relay_pin->pin()); - gpioUnlock(relay_pin->pin()); + DEBUG_MSG_P(PSTR("[IFAN] Could not add relay provider for GPIO%d\n"), controlPin()); + gpioUnlock(controlPin()); } }