diff --git a/tasmota/support_legacy_cores.ino b/tasmota/support_cores.ino similarity index 65% rename from tasmota/support_legacy_cores.ino rename to tasmota/support_cores.ino index e9a78e5ee..855768bbf 100644 --- a/tasmota/support_legacy_cores.ino +++ b/tasmota/support_cores.ino @@ -1,5 +1,5 @@ /* - support_legacy_cores.ino - Legacy arduino core support for Tasmota + support_cores.ino - Arduino core support for Tasmota Copyright (C) 2020 Theo Arends @@ -35,3 +35,29 @@ void resetPins() } */ } + +/*********************************************************************************************\ + * Hardware related +\*********************************************************************************************/ + +#ifdef ESP8266 + +void HwWdtDisable(void) { + *((volatile uint32_t*) 0x60000900) &= ~(1); // Hardware WDT OFF +} + +void HwWdtEnable(void) { + *((volatile uint32_t*) 0x60000900) |= 1; // Hardware WDT ON +} + +void WdtDisable(void) { + ESP.wdtDisable(); + HwWdtDisable(); +} + +void WdtEnable(void) { + HwWdtEnable(); + ESP.wdtEnable(0); +} + +#endif // ESP8266