mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 01:40:14 +01:00
ports: Move definitions of ATOMIC_SECTION macros to mphalport.h.
Also move MICROPY_PY_PENDSV_ENTER/REENTER/EXIT to mphalport.h, for ports where these are not already there. This helps separate the hardware implementation of these macros from the MicroPython configuration (eg for renesas-ra and stm32, the IRQ static inline helper functions can now be moved to irq.h). Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -244,12 +244,6 @@ extern const struct _mp_obj_type_t mod_network_nic_type_wiznet5k;
|
||||
#define MICROPY_HW_BOOTSEL_DELAY_US 8
|
||||
#endif
|
||||
|
||||
// Entering a critical section.
|
||||
extern uint32_t mp_thread_begin_atomic_section(void);
|
||||
extern void mp_thread_end_atomic_section(uint32_t);
|
||||
#define MICROPY_BEGIN_ATOMIC_SECTION() mp_thread_begin_atomic_section()
|
||||
#define MICROPY_END_ATOMIC_SECTION(state) mp_thread_end_atomic_section(state)
|
||||
|
||||
// Prevent the "lwIP task" from running when unsafe to do so.
|
||||
#define MICROPY_PY_LWIP_ENTER lwip_lock_acquire();
|
||||
#define MICROPY_PY_LWIP_REENTER lwip_lock_acquire();
|
||||
|
||||
Reference in New Issue
Block a user