Skip to content

Commit 2097b5e

Browse files
committed
Simplify and Fix support for esp8266 core v3+
1 parent aa76d26 commit 2097b5e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

hal/architecture/ESP8266/MyHwESP8266.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* version 2 as published by the Free Software Foundation.
1818
*/
1919

20+
#include <Schedule.h>
2021
#include "MyHwESP8266.h"
2122

2223
bool hwInit(void)
@@ -29,7 +30,12 @@ bool hwInit(void)
2930
#endif
3031
#endif
3132
EEPROM.begin(EEPROM_size);
32-
return true;
33+
// register _process() to be called at most every 1us,
34+
// at every loop() or yield()
35+
return schedule_recurrent_function_us([]() {
36+
_process();
37+
return true;
38+
}, 1);
3339
}
3440

3541
void hwReadConfigBlock(void *buf, void *addr, size_t length)

hal/architecture/ESP8266/MyMainESP8266.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if 0 // replaced by a call to schedule_recurrent_function_us()
12
/*
23
* The MySensors Arduino library handles the wireless radio link and protocol
34
* between your home built sensors/actuators and HA controller of choice.
@@ -346,3 +347,4 @@ extern "C" void user_init(void)
346347

347348
system_init_done_cb(&init_done);
348349
}
350+
#endif

0 commit comments

Comments
 (0)