8000 py: Fix dummy definition of BEGIN/END_ATOMIC_SECTION. · alexbartlow/circuitpython@4859edb · GitHub
[go: up one dir, main page]

Skip to content

Commit 4859edb

Browse files
committed
py: Fix dummy definition of BEGIN/END_ATOMIC_SECTION.
1 parent 95908b0 commit 4859edb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

py/mpconfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,10 @@ typedef double mp_float_t;
431431

432432
// On embedded platforms, these will typically enable/disable irqs.
433433
#ifndef MICROPY_BEGIN_ATOMIC_SECTION
434-
#define MICROPY_BEGIN_ATOMIC_SECTION()
434+
#define MICROPY_BEGIN_ATOMIC_SECTION() (0)
435435
#endif
436436
#ifndef MICROPY_END_ATOMIC_SECTION
437-
#define MICROPY_END_ATOMIC_SECTION()
437+
#define MICROPY_END_ATOMIC_SECTION(state) (void)(state)
438438
#endif
439439

440440
// Allow to override static modifier for global objects, e.g. to use with

py/objexcept.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ mp_obj_t mp_alloc_emergency_exception_buf(mp_obj_t size_in) {
8888

8989
// Update the 2 variables atomically so that an interrupt can't occur
9090
// between the assignments.
91-
mp_uint_t irq_state = MICROPY_BEGIN_ATOMIC_SECTION();
91+
mp_uint_t atomic_state = MICROPY_BEGIN_ATOMIC_SECTION();
9292
mp_emergency_exception_buf_size = size;
9393
mp_emergency_exception_buf = buf;
94-
MICROPY_END_ATOMIC_SECTION(irq_state);
94+
MICROPY_END_ATOMIC_SECTION(atomic_state);
9595

9696
if (old_buf != NULL) {
9797
m_free(old_buf, old_size);

0 commit comments

Comments
 (0)
0