summaryrefslogtreecommitdiff
path: root/py/objexcept.c
diff options
context:
space:
mode:
authorDave Hylands <dhylands@gmail.com>2014-08-24 12:21:12 -0700
committerDamien George <damien.p.george@gmail.com>2014-08-25 12:22:11 +0100
commit9480138f0c917b2400991066e94636f7d8076a4c (patch)
treed934be3cfd588ec510988371d0d8c891b48db6d3 /py/objexcept.c
parent7310fd469a4dfdd38fda242f138f5671c2f82b61 (diff)
Add save/restore_irq
Factored irq functions into a separate file.
Diffstat (limited to 'py/objexcept.c')
-rw-r--r--py/objexcept.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/objexcept.c b/py/objexcept.c
index cddc77bfe..7f9b219d5 100644
--- a/py/objexcept.c
+++ b/py/objexcept.c
@@ -88,10 +88,10 @@ mp_obj_t mp_alloc_emergency_exception_buf(mp_obj_t size_in) {
// Update the 2 variables atomically so that an interrupt can't occur
// between the assignments.
- MICROPY_BEGIN_ATOMIC_SECTION();
+ mp_int_t enabled = MICROPY_BEGIN_ATOMIC_SECTION();
mp_emergency_exception_buf_size = size;
mp_emergency_exception_buf = buf;
- MICROPY_END_ATOMIC_SECTION();
+ MICROPY_END_ATOMIC_SECTION(enabled);
if (old_buf != NULL) {
m_free(old_buf, old_size);