Browse Source

Option to disable LED support

rfm69
Xose Pérez 6 years ago
parent
commit
210cd8df71
5 changed files with 20 additions and 3 deletions
  1. +8
    -0
      code/espurna/config/general.h
  2. +1
    -0
      code/espurna/config/hardware.h
  3. +4
    -2
      code/espurna/espurna.ino
  4. +4
    -0
      code/espurna/led.ino
  5. +3
    -1
      code/espurna/relay.ino

+ 8
- 0
code/espurna/config/general.h View File

@ -217,6 +217,14 @@
#define BUTTON_LNGLNGCLICK_DELAY 10000 // Time in ms holding the button down to get a long-long click #define BUTTON_LNGLNGCLICK_DELAY 10000 // Time in ms holding the button down to get a long-long click
#endif #endif
//------------------------------------------------------------------------------
// LED
//------------------------------------------------------------------------------
#ifndef LED_SUPPORT
#define LED_SUPPORT 1
#endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// RELAY // RELAY
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------


+ 1
- 0
code/espurna/config/hardware.h View File

@ -52,6 +52,7 @@
//#define DEBUG_SERIAL_SUPPORT 0 //#define DEBUG_SERIAL_SUPPORT 0
//#define DEBUG_TELNET_SUPPORT 0 //#define DEBUG_TELNET_SUPPORT 0
//#define DEBUG_WEB_SUPPORT 0 //#define DEBUG_WEB_SUPPORT 0
//#define LED_SUPPORT 0
//#define TELNET_SUPPORT 0 //#define TELNET_SUPPORT 0
//#define TERMINAL_SUPPORT 0 //#define TERMINAL_SUPPORT 0


+ 4
- 2
code/espurna/espurna.ino View File

@ -49,7 +49,7 @@ void setup() {
// Init EEPROM // Init EEPROM
eepromSetup(); eepromSetup();
// Init Serial, SPIFFS and system check // Init Serial, SPIFFS and system check
systemSetup(); systemSetup();
@ -100,7 +100,9 @@ void setup() {
relaySetup(); relaySetup();
buttonSetup(); buttonSetup();
ledSetup();
#if LED_SUPPORT
ledSetup();
#endif
#if MQTT_SUPPORT #if MQTT_SUPPORT
mqttSetup(); mqttSetup();
#endif #endif


+ 4
- 0
code/espurna/led.ino View File

@ -10,6 +10,8 @@ Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
// LED // LED
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
#if LED_SUPPORT
typedef struct { typedef struct {
unsigned char pin; unsigned char pin;
bool reverse; bool reverse;
@ -290,3 +292,5 @@ void ledLoop() {
_led_update = false; _led_update = false;
} }
#endif LED_SUPPORT

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

@ -194,7 +194,9 @@ void _relayProcess(bool mode) {
#endif #endif
// Flag relay-based LEDs to update status // Flag relay-based LEDs to update status
ledUpdate(true);
#if LED_SUPPORT
ledUpdate(true);
#endif
_relays[id].report = false; _relays[id].report = false;
_relays[id].group_report = false; _relays[id].group_report = false;


Loading…
Cancel
Save