Skip to content

Commit 419d1aa

Browse files
committed
esp8266/mpconfigport.h: Add definitions for BEGIN/END_ATOMIC_SECTION.
These are needed to ensure correct operation of the MicroPython scheduler.
1 parent 0bd58a5 commit 419d1aa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ports/esp8266/mpconfigport.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@
114114
#define MICROPY_VM_HOOK_LOOP MICROPY_VM_HOOK_POLL
115115
#define MICROPY_VM_HOOK_RETURN MICROPY_VM_HOOK_POLL
116116

117+
#include "xtirq.h"
118+
#define MICROPY_BEGIN_ATOMIC_SECTION() disable_irq()
119+
#define MICROPY_END_ATOMIC_SECTION(state) enable_irq(state)
120+
117121
// type definitions for the specific machine
118122

119123
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void *)((mp_uint_t)(p)))

0 commit comments

Comments
 (0)