diff --git a/devices/relay/relay.ino b/devices/relay/relay.ino index c8fbc52..00bf6cc 100755 --- a/devices/relay/relay.ino +++ b/devices/relay/relay.ino @@ -221,6 +221,8 @@ void setup() { + coreSetup(); + for (uint8_t ch = 0; ch < CHANNEL_NUM; ch++) { uint8_t pin = sh_channel_pin(ch); if (pin == SH_PIN_UNUSED) continue; @@ -228,8 +230,6 @@ } relayLoadStates(); - - coreSetup(); } void loop() { diff --git a/devices/sh_core_esp8266/src/sh_core.cpp b/devices/sh_core_esp8266/src/sh_core.cpp index d5ac9a1..5963504 100644 --- a/devices/sh_core_esp8266/src/sh_core.cpp +++ b/devices/sh_core_esp8266/src/sh_core.cpp @@ -445,7 +445,7 @@ bool sh_channel_is_inverted(uint8_t ch) { uint8_t flags = sh_channel_get_u8(ch, SH_CH_RESERVED); if (flags == SH_PIN_UNUSED) flags = 0; - return flags == SH_CH_FLAG_INVERT; + return flags == 1; } void sh_channel_set_inverted(uint8_t ch, bool inverted) { @@ -464,7 +464,7 @@ // -------------------- Core setup / loop -------------------- void coreSetup() { Serial.begin(115200); - delay(1200); + delay(200); Serial.println(); Serial.println(F("Booting..."));