ports: Move MICROPY_PY_LWIP_ENTER/REENTER/EXIT defns to mphalport.h.

Following ad806df857 where the
MICROPY_PY_PENDSV_ENTER/REENTER/EXIT macro definitions were moved to
mphalport.h.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2024-01-05 15:37:17 +11:00
parent ee226a8b43
commit d45176fc27
8 changed files with 19 additions and 19 deletions

View File

@ -134,11 +134,6 @@ uint32_t trng_random_u32(void);
#define MICROPY_PY_HASHLIB_SHA1 (MICROPY_PY_SSL) #define MICROPY_PY_HASHLIB_SHA1 (MICROPY_PY_SSL)
// #define MICROPY_PY_CRYPTOLIB (MICROPY_PY_SSL) // #define MICROPY_PY_CRYPTOLIB (MICROPY_PY_SSL)
// Prevent the "LWIP task" from running.
#define MICROPY_PY_LWIP_ENTER MICROPY_PY_PENDSV_ENTER
#define MICROPY_PY_LWIP_REENTER MICROPY_PY_PENDSV_REENTER
#define MICROPY_PY_LWIP_EXIT MICROPY_PY_PENDSV_EXIT
#ifndef MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE #ifndef MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
#define MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE (1) #define MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE (1)
#endif #endif

View File

@ -45,6 +45,11 @@
#define MICROPY_PY_PENDSV_REENTER atomic_state = raise_irq_pri(IRQ_PRI_PENDSV); #define MICROPY_PY_PENDSV_REENTER atomic_state = raise_irq_pri(IRQ_PRI_PENDSV);
#define MICROPY_PY_PENDSV_EXIT restore_irq_pri(atomic_state); #define MICROPY_PY_PENDSV_EXIT restore_irq_pri(atomic_state);
// Prevent the "lwIP task" from running.
#define MICROPY_PY_LWIP_ENTER MICROPY_PY_PENDSV_ENTER
#define MICROPY_PY_LWIP_REENTER MICROPY_PY_PENDSV_REENTER
#define MICROPY_PY_LWIP_EXIT MICROPY_PY_PENDSV_EXIT
#define MICROPY_HW_USB_CDC_TX_TIMEOUT (500) #define MICROPY_HW_USB_CDC_TX_TIMEOUT (500)
#define MP_HAL_PIN_FMT "%q" #define MP_HAL_PIN_FMT "%q"

View File

@ -292,10 +292,6 @@ typedef long mp_off_t;
#define MICROPY_THREAD_YIELD() #define MICROPY_THREAD_YIELD()
#endif #endif
#define MICROPY_PY_LWIP_ENTER
#define MICROPY_PY_LWIP_REENTER
#define MICROPY_PY_LWIP_EXIT
#ifndef MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE #ifndef MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
#define MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE (1) #define MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE (1)
#endif #endif

View File

@ -35,6 +35,10 @@
#define MICROPY_PY_PENDSV_ENTER uint32_t atomic_state = raise_irq_pri(IRQ_PRI_PENDSV) #define MICROPY_PY_PENDSV_ENTER uint32_t atomic_state = raise_irq_pri(IRQ_PRI_PENDSV)
#define MICROPY_PY_PENDSV_EXIT restore_irq_pri(atomic_state) #define MICROPY_PY_PENDSV_EXIT restore_irq_pri(atomic_state)
#define MICROPY_PY_LWIP_ENTER
#define MICROPY_PY_LWIP_REENTER
#define MICROPY_PY_LWIP_EXIT
#define MICROPY_HW_USB_CDC_TX_TIMEOUT (500) #define MICROPY_HW_USB_CDC_TX_TIMEOUT (500)
extern const unsigned char mp_hal_status_to_errno_table[4]; extern const unsigned char mp_hal_status_to_errno_table[4];

View File

@ -245,11 +245,6 @@ extern const struct _mp_obj_type_t mod_network_nic_type_wiznet5k;
#define MICROPY_HW_BOOTSEL_DELAY_US 8 #define MICROPY_HW_BOOTSEL_DELAY_US 8
#endif #endif
// 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();
#define MICROPY_PY_LWIP_EXIT lwip_lock_release();
// Port level Wait-for-Event macro // Port level Wait-for-Event macro
// //
// Do not use this macro directly, include py/runtime.h and // Do not use this macro directly, include py/runtime.h and

View File

@ -43,6 +43,11 @@
#define MICROPY_PY_PENDSV_ENTER pendsv_suspend() #define MICROPY_PY_PENDSV_ENTER pendsv_suspend()
#define MICROPY_PY_PENDSV_EXIT pendsv_resume() #define MICROPY_PY_PENDSV_EXIT pendsv_resume()
// 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();
#define MICROPY_PY_LWIP_EXIT lwip_lock_release();
extern int mp_interrupt_char; extern int mp_interrupt_char;
extern ringbuf_t stdin_ringbuf; extern ringbuf_t stdin_ringbuf;

View File

@ -268,11 +268,6 @@ typedef long mp_off_t;
// Configuration for shared/runtime/softtimer.c. // Configuration for shared/runtime/softtimer.c.
#define MICROPY_SOFT_TIMER_TICKS_MS uwTick #define MICROPY_SOFT_TIMER_TICKS_MS uwTick
// Prevent the "LWIP task" from running.
#define MICROPY_PY_LWIP_ENTER MICROPY_PY_PENDSV_ENTER
#define MICROPY_PY_LWIP_REENTER MICROPY_PY_PENDSV_REENTER
#define MICROPY_PY_LWIP_EXIT MICROPY_PY_PENDSV_EXIT
#ifndef MICROPY_PY_NETWORK_HOSTNAME_DEFAULT #ifndef MICROPY_PY_NETWORK_HOSTNAME_DEFAULT
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "mpy-stm32" #define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "mpy-stm32"
#endif #endif

View File

@ -53,6 +53,11 @@ void mp_hal_set_interrupt_char(int c); // -1 to disable
#define MICROPY_PY_PENDSV_REENTER atomic_state = raise_irq_pri(IRQ_PRI_PENDSV); #define MICROPY_PY_PENDSV_REENTER atomic_state = raise_irq_pri(IRQ_PRI_PENDSV);
#define MICROPY_PY_PENDSV_EXIT restore_irq_pri(atomic_state); #define MICROPY_PY_PENDSV_EXIT restore_irq_pri(atomic_state);
// Prevent the "lwIP task" from running.
#define MICROPY_PY_LWIP_ENTER MICROPY_PY_PENDSV_ENTER
#define MICROPY_PY_LWIP_REENTER MICROPY_PY_PENDSV_REENTER
#define MICROPY_PY_LWIP_EXIT MICROPY_PY_PENDSV_EXIT
// Timing functions. // Timing functions.
#if __CORTEX_M == 0 #if __CORTEX_M == 0