summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-04-23 16:19:43 +1000
committerDamien George <damien.p.george@gmail.com>2020-04-30 23:47:11 +1000
commit419d1aa617d2974d0ff82488da6fa141a8df14a2 (patch)
tree4c9f6f863fdc607af630e1d289a65a9f03628545
parent0bd58a56137bd9124756ed0f57b4213daccfc7d5 (diff)
esp8266/mpconfigport.h: Add definitions for BEGIN/END_ATOMIC_SECTION.
These are needed to ensure correct operation of the MicroPython scheduler.
-rw-r--r--ports/esp8266/mpconfigport.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/ports/esp8266/mpconfigport.h b/ports/esp8266/mpconfigport.h
index e27ae1792..5344a98d6 100644
--- a/ports/esp8266/mpconfigport.h
+++ b/ports/esp8266/mpconfigport.h
@@ -114,6 +114,10 @@
#define MICROPY_VM_HOOK_LOOP MICROPY_VM_HOOK_POLL
#define MICROPY_VM_HOOK_RETURN MICROPY_VM_HOOK_POLL
+#include "xtirq.h"
+#define MICROPY_BEGIN_ATOMIC_SECTION() disable_irq()
+#define MICROPY_END_ATOMIC_SECTION(state) enable_irq(state)
+
// type definitions for the specific machine
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void *)((mp_uint_t)(p)))