mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
Add save/restore_irq
Factored irq functions into a separate file.
This commit is contained in:
committed by
Damien George
parent
7310fd469a
commit
9480138f0c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user