diff --git a/hal/architecture/ESP8266/MyHwESP8266.cpp b/hal/architecture/ESP8266/MyHwESP8266.cpp index 5bfca8d37..c9f7d2bff 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,9 @@ 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