From 752fad8b19ec487229e4b67847a1dc453ed1c165 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 22 Mar 2020 16:18:48 +0100 Subject: [PATCH] Disable reset pins from core Disable reset pins from core. Works with core below 2.5.0 and 2.6.3 + e64cb619f (or current STAGE). Should stop relay toggling at restart. --- tasmota/core_esp8266_wiring_digital.c | 2 ++ tasmota/support_legacy_cores.ino | 21 +++++++++++++++++++++ tasmota/tasmota_post.h | 1 + 3 files changed, 24 insertions(+) diff --git a/tasmota/core_esp8266_wiring_digital.c b/tasmota/core_esp8266_wiring_digital.c index f8d521748..4b9ab252b 100644 --- a/tasmota/core_esp8266_wiring_digital.c +++ b/tasmota/core_esp8266_wiring_digital.c @@ -196,6 +196,7 @@ void initPins(void) { U0IE = 0; U1IE = 0; +/* for (int i = 0; i <= 5; ++i) { pinMode(i, INPUT); } @@ -203,6 +204,7 @@ void initPins(void) { for (int i = 12; i <= 16; ++i) { pinMode(i, INPUT); } +*/ ETS_GPIO_INTR_ATTACH(interrupt_handler, &interrupt_reg); ETS_GPIO_INTR_ENABLE(); diff --git a/tasmota/support_legacy_cores.ino b/tasmota/support_legacy_cores.ino index f8c5b3060..0d429c75f 100644 --- a/tasmota/support_legacy_cores.ino +++ b/tasmota/support_legacy_cores.ino @@ -155,3 +155,24 @@ void* memmove_P(void *dest, const void *src, size_t n) } #endif // ARDUINO_ESP8266_RELEASE < 2_6_0 + + + +/*********************************************************************************************\ + * Core overrides +\*********************************************************************************************/ + +// Add below line to tasmota_post.h +// extern "C" void resetPins(); +void resetPins() +{ +/* + for (int i = 0; i <= 5; ++i) { + pinMode(i, INPUT); + } + // pins 6-11 are used for the SPI flash interface + for (int i = 12; i <= 16; ++i) { + pinMode(i, INPUT); + } +*/ +} diff --git a/tasmota/tasmota_post.h b/tasmota/tasmota_post.h index b9bc6a833..1bba02172 100644 --- a/tasmota/tasmota_post.h +++ b/tasmota/tasmota_post.h @@ -41,6 +41,7 @@ void KNX_CB_Action(message_t const &msg, void *arg); void DomoticzTempHumPressureSensor(float temp, float hum, float baro = -1); char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, char inbetween = '\0'); extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack, uint32_t stack_end); +extern "C" void resetPins(); /*********************************************************************************************\ * Default global defines