From 1944f563a4de8e84fa90e9d97c1eb02eb7fdf0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Jonas=20S=C3=A4mann?= Date: Tue, 14 Apr 2020 02:33:07 +0200 Subject: [PATCH] Make default reset button gpio configurable Especially on some custom devices wich need custom builds, the variable is missing. This provides a new environment variable to customize the default pin for the reset button. --- src/Custom-sample.h | 2 ++ src/Misc.ino | 2 +- src/src/DataStructs/ESPEasyDefaults.h | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Custom-sample.h b/src/Custom-sample.h index ce9952a57..ce186b638 100644 --- a/src/Custom-sample.h +++ b/src/Custom-sample.h @@ -102,6 +102,8 @@ #define DEFAULT_PIN_STATUS_LED (-1) #define DEFAULT_PIN_STATUS_LED_INVERSED true +#define DEFAULT_PIN_RESET_BUTTON (-1) + #define DEFAULT_USE_RULES false // (true|false) Enable Rules? #define DEFAULT_RULES_OLDENGINE true diff --git a/src/Misc.ino b/src/Misc.ino index d4dc6666f..acedfada0 100644 --- a/src/Misc.ino +++ b/src/Misc.ino @@ -1180,7 +1180,7 @@ void ResetFactory() Settings.Pin_status_led = gpio_settings.status_led; Settings.Pin_status_led_Inversed = DEFAULT_PIN_STATUS_LED_INVERSED; Settings.Pin_sd_cs = -1; - Settings.Pin_Reset = -1; + Settings.Pin_Reset = DEFAULT_PIN_RESET_BUTTON; Settings.Protocol[0] = DEFAULT_PROTOCOL; Settings.deepSleep_wakeTime = false; Settings.CustomCSS = false; diff --git a/src/src/DataStructs/ESPEasyDefaults.h b/src/src/DataStructs/ESPEasyDefaults.h index b2597308f..860ae4113 100644 --- a/src/src/DataStructs/ESPEasyDefaults.h +++ b/src/src/DataStructs/ESPEasyDefaults.h @@ -168,6 +168,9 @@ #define DEFAULT_PIN_STATUS_LED_INVERSED true #endif +#ifndef DEFAULT_PIN_RESET_BUTTON +#define DEFAULT_PIN_RESET_BUTTON (-1) +#endif // --- Advanced Settings ---------------------------------------------------------------------------------