Browse Source

Fixed update of led bug and GPIO16 support (#2110)

* Fixed ignorance from the 16th PIN on ESP8266

* Added update to led every change of relay

* per https://github.com/xoseperez/espurna/pull/2110#discussion_r367551042

* gpio16 comment

Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>
mcspr-patch-1
foxman69 4 years ago
committed by Max Prokhorov
parent
commit
ac2f9c2c57
3 changed files with 7 additions and 3 deletions
  1. +4
    -0
      code/espurna/config/dependencies.h
  2. +3
    -2
      code/espurna/gpio.ino
  3. +0
    -1
      code/espurna/relay.ino

+ 4
- 0
code/espurna/config/dependencies.h View File

@ -47,6 +47,10 @@
#define MQTT_SUPPORT 1
#endif
#if LED_SUPPORT
#undef BROKER_SUPPORT
#define BROKER_SUPPORT 1 // If LED is enabled enable BROKER to supply status changes
#endif
#if INFLUXDB_SUPPORT
#undef BROKER_SUPPORT


+ 3
- 2
code/espurna/gpio.ino View File

@ -8,7 +8,7 @@ Copyright (C) 2017-2019 by Xose Pérez <xose dot perez at gmail dot com>
#include <bitset>
constexpr const size_t GPIO_PINS = 16;
constexpr const size_t GPIO_PINS = 17;
std::bitset<GPIO_PINS> _gpio_locked;
std::bitset<GPIO_PINS> _gpio_available;
@ -59,10 +59,11 @@ void gpioSetup() {
|| (efuse_blocks[2] & (1 << 16))
);
// TODO: GPIO16 is only for basic I/O, gpioGetLock before attachInterrupt should check for that
for (unsigned char pin=0; pin < GPIO_PINS; ++pin) {
if (pin <= 5) _gpio_available.set(pin);
if (((pin == 9) || (pin == 10)) && (esp8285)) _gpio_available.set(pin);
if (12 <= pin && pin <= 15) _gpio_available.set(pin);
if (12 <= pin && pin <= 16) _gpio_available.set(pin);
}
}

+ 0
- 1
code/espurna/relay.ino View File

@ -383,7 +383,6 @@ void _relayProcess(bool mode) {
if (_relay_sync_locked && needs_unlock && changed) {
_relaySyncUnlock();
}
}
#if defined(ITEAD_SONOFF_IFAN02)


Loading…
Cancel
Save