Add save/restore_irq

Factored irq functions into a separate file.
This commit is contained in:
Dave Hylands
2014-08-24 12:21:12 -07:00
committed by Damien George
parent 7310fd469a
commit 9480138f0c
11 changed files with 144 additions and 72 deletions

View File

@@ -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);