From 2097b5e58ee74b7e6e9e5d43f8f9674f6ef8b921 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Thu, 11 Nov 2021 15:09:49 +0100 Subject: [PATCH 1/2] Simplify and Fix support for esp8266 core v3+ --- hal/architecture/ESP8266/MyHwESP8266.cpp | 8 +++++++- hal/architecture/ESP8266/MyMainESP8266.cpp | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hal/architecture/ESP8266/MyHwESP8266.cpp b/hal/architecture/ESP8266/MyHwESP8266.cpp index 5bfca8d37..d76e2cf61 100644 --- a/hal/architecture/ESP8266/MyHwESP8266.cpp +++ b/hal/architecture/ESP8266/MyHwESP8266.cpp @@ -17,6 +17,7 @@ * version 2 as published by the Free Software Foundation. */ +#include #include "MyHwESP8266.h" bool hwInit(void) @@ -29,7 +30,12 @@ bool hwInit(void) #endif #endif EEPROM.begin(EEPROM_size); - return true; + // register _process() to be called at most every 1us, + // at every loop() or yield() + return schedule_recurrent_function_us([]() { + _process(); + return true; + }, 1); } void hwReadConfigBlock(void *buf, void *addr, size_t length) diff --git a/hal/architecture/ESP8266/MyMainESP8266.cpp b/hal/architecture/ESP8266/MyMainESP8266.cpp index 8b3c4283c..f9b74cb8f 100644 --- a/hal/architecture/ESP8266/MyMainESP8266.cpp +++ b/hal/architecture/ESP8266/MyMainESP8266.cpp @@ -1,3 +1,4 @@ +#if 0 // replaced by a call to schedule_recurrent_function_us() /* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. @@ -346,3 +347,4 @@ extern "C" void user_init(void) system_init_done_cb(&init_done); } +#endif From 9b5c60b0be00c7ed9db77e48250252f252447940 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Mon, 11 Jul 2022 17:51:23 +0200 Subject: [PATCH 2/2] Delete MyMainESP8266.cpp --- hal/architecture/ESP8266/MyMainESP8266.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 hal/architecture/ESP8266/MyMainESP8266.cpp diff --git a/hal/architecture/ESP8266/MyMainESP8266.cpp b/hal/architecture/ESP8266/MyMainESP8266.cpp deleted file mode 100644 index e69de29bb..000000000