aboutsummaryrefslogtreecommitdiff
path: root/teensy/mpconfigport.h
diff options
context:
space:
mode:
Diffstat (limited to 'teensy/mpconfigport.h')
-rw-r--r--teensy/mpconfigport.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/teensy/mpconfigport.h b/teensy/mpconfigport.h
index 697106378..ec68c9b5b 100644
--- a/teensy/mpconfigport.h
+++ b/teensy/mpconfigport.h
@@ -51,6 +51,12 @@ typedef unsigned int mp_uint_t; // must be pointer size
typedef void *machine_ptr_t; // must be of pointer size
typedef const void *machine_const_ptr_t; // must be of pointer size
+mp_int_t disable_irq(void);
+void enable_irq(mp_int_t enable);
+
+#define MICROPY_BEGIN_ATOMIC_SECTION() disable_irq()
+#define MICROPY_END_ATOMIC_SECTION(enable) enable_irq(enable)
+
// There is no classical C heap in bare-metal ports, only Python
// garbage-collected heap. For completeness, emulate C heap via
// GC heap. Note that MicroPython core never uses malloc() and friends,