From 152bf22fdd2b069bffd5d22752b4172a59703b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Thu, 28 Jun 2018 14:08:49 +0200 Subject: [PATCH] Option to disable button support --- code/espurna/button.ino | 4 ++++ code/espurna/config/general.h | 4 ++++ code/espurna/config/hardware.h | 1 + code/espurna/espurna.ino | 4 +++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/code/espurna/button.ino b/code/espurna/button.ino index ea550e1f..4d8afef5 100644 --- a/code/espurna/button.ino +++ b/code/espurna/button.ino @@ -10,6 +10,8 @@ Copyright (C) 2016-2018 by Xose PĂ©rez // BUTTON // ----------------------------------------------------------------------------- +#if BUTTON_SUPPORT + #include #include @@ -266,3 +268,5 @@ void buttonLoop() { #endif } + +#endif // BUTTON_SUPPORT diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 8c10f7c7..60783df6 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -201,6 +201,10 @@ // BUTTON //------------------------------------------------------------------------------ +#ifndef BUTTON_SUPPORT +#define BUTTON_SUPPORT 1 +#endif + #ifndef BUTTON_DEBOUNCE_DELAY #define BUTTON_DEBOUNCE_DELAY 50 // Debounce delay (ms) #endif diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index c200cc77..69a69ec3 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -37,6 +37,7 @@ // Disable non-core modules #define ALEXA_SUPPORT 0 #define BROKER_SUPPORT 0 + #define BUTTON_SUPPORT 0 #define DOMOTICZ_SUPPORT 0 #define HOMEASSISTANT_SUPPORT 0 #define I2C_SUPPORT 0 diff --git a/code/espurna/espurna.ino b/code/espurna/espurna.ino index 852055da..c064aa20 100644 --- a/code/espurna/espurna.ino +++ b/code/espurna/espurna.ino @@ -99,7 +99,9 @@ void setup() { #endif relaySetup(); - buttonSetup(); + #if BUTTON_SUPPORT + buttonSetup(); + #endif #if LED_SUPPORT ledSetup(); #endif