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:
@@ -139,6 +139,3 @@ typedef long mp_off_t;
|
||||
// extra built in names to add to the global namespace
|
||||
#define MICROPY_PORT_BUILTINS \
|
||||
{ MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) },
|
||||
|
||||
#define MICROPY_BEGIN_ATOMIC_SECTION irq_lock
|
||||
#define MICROPY_END_ATOMIC_SECTION irq_unlock
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#include <zephyr/zephyr.h>
|
||||
#include "shared/runtime/interrupt_char.h"
|
||||
|
||||
#define MICROPY_BEGIN_ATOMIC_SECTION irq_lock
|
||||
#define MICROPY_END_ATOMIC_SECTION irq_unlock
|
||||
|
||||
void mp_hal_init(void);
|
||||
void mp_hal_wait_sem(struct k_sem *sem, uint32_t timeout_ms);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user