From d8960c1a15a168a8dc507dcafd67a345451a6719 Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Sun, 27 Jun 2021 02:43:31 +0200 Subject: [PATCH] Fix Dimmer issue after boot --- src/sys/gpio/hasp_gpio.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sys/gpio/hasp_gpio.cpp b/src/sys/gpio/hasp_gpio.cpp index 66e20cd0..504827ac 100644 --- a/src/sys/gpio/hasp_gpio.cpp +++ b/src/sys/gpio/hasp_gpio.cpp @@ -253,6 +253,8 @@ static void gpio_setup_pin(uint8_t index) case hasp_gpio_type_t::LED... hasp_gpio_type_t::LED_W: // case hasp_gpio_type_t::BACKLIGHT: pinMode(gpio->pin, OUTPUT); + gpio->power = gpio->inverted; // gpio is off, state is set to reflect the true output state of the gpio + gpio->val = gpio->inverted ? 0 : gpio->max; #if defined(ARDUINO_ARCH_ESP32) if(pwm_channel < 16) { // configure LED PWM functionalitites