summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-01-05 15:37:17 +1100
committerDamien George <damien@micropython.org>2024-01-05 15:40:06 +1100
commitd45176fc271d4d5e264bec2809faeb906787a6f9 (patch)
treebdfca0ca2adf8f0e6ea195a9a5d5b0dd064055e8
parentee226a8b4340111eee0b13e7b840948f4bb70465 (diff)
ports: Move MICROPY_PY_LWIP_ENTER/REENTER/EXIT defns to mphalport.h.
Following ad806df857b52e9814dbd857b14f09b63eb847fe where the MICROPY_PY_PENDSV_ENTER/REENTER/EXIT macro definitions were moved to mphalport.h. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/mimxrt/mpconfigport.h5
-rw-r--r--ports/mimxrt/mphalport.h5
-rw-r--r--ports/renesas-ra/mpconfigport.h4
-rw-r--r--ports/renesas-ra/mphalport.h4
-rw-r--r--ports/rp2/mpconfigport.h5
-rw-r--r--ports/rp2/mphalport.h5
-rw-r--r--ports/stm32/mpconfigport.h5
-rw-r--r--ports/stm32/mphalport.h5
8 files changed, 19 insertions, 19 deletions
diff --git a/ports/mimxrt/mpconfigport.h b/ports/mimxrt/mpconfigport.h
index 5feb5b62b..c67b010c0 100644
--- a/ports/mimxrt/mpconfigport.h
+++ b/ports/mimxrt/mpconfigport.h
@@ -134,11 +134,6 @@ uint32_t trng_random_u32(void);
#define MICROPY_PY_HASHLIB_SHA1 (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
#define MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE (1)
#endif
diff --git a/ports/mimxrt/mphalport.h b/ports/mimxrt/mphalport.h
index 4f1f4bfd1..7f5a228fa 100644
--- a/ports/mimxrt/mphalport.h
+++ b/ports/mimxrt/mphalport.h
@@ -45,6 +45,11 @@
#define MICROPY_PY_PENDSV_REENTER atomic_state = raise_irq_pri(IRQ_PRI_PENDSV);
#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 MP_HAL_PIN_FMT "%q"
diff --git a/ports/renesas-ra/mpconfigport.h b/ports/renesas-ra/mpconfigport.h
index 63537fa5a..ebd055f2e 100644
--- a/ports/renesas-ra/mpconfigport.h
+++ b/ports/renesas-ra/mpconfigport.h
@@ -292,10 +292,6 @@ typedef long mp_off_t;
#define MICROPY_THREAD_YIELD()
#endif
-#define MICROPY_PY_LWIP_ENTER
-#define MICROPY_PY_LWIP_REENTER
-#define MICROPY_PY_LWIP_EXIT
-
#ifndef MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
#define MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE (1)
#endif
diff --git a/ports/renesas-ra/mphalport.h b/ports/renesas-ra/mphalport.h
index b8441e376..c5d27f2e4 100644
--- a/ports/renesas-ra/mphalport.h
+++ b/ports/renesas-ra/mphalport.h
@@ -35,6 +35,10 @@
#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_LWIP_ENTER
+#define MICROPY_PY_LWIP_REENTER
+#define MICROPY_PY_LWIP_EXIT
+
#define MICROPY_HW_USB_CDC_TX_TIMEOUT (500)
extern const unsigned char mp_hal_status_to_errno_table[4];
diff --git a/ports/rp2/mpconfigport.h b/ports/rp2/mpconfigport.h
index 1cc9b9616..8431357ff 100644
--- a/ports/rp2/mpconfigport.h
+++ b/ports/rp2/mpconfigport.h
@@ -245,11 +245,6 @@ extern const struct _mp_obj_type_t mod_network_nic_type_wiznet5k;
#define MICROPY_HW_BOOTSEL_DELAY_US 8
#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
//
// Do not use this macro directly, include py/runtime.h and
diff --git a/ports/rp2/mphalport.h b/ports/rp2/mphalport.h
index 9feace2f4..b2576c227 100644
--- a/ports/rp2/mphalport.h
+++ b/ports/rp2/mphalport.h
@@ -43,6 +43,11 @@
#define MICROPY_PY_PENDSV_ENTER pendsv_suspend()
#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 ringbuf_t stdin_ringbuf;
diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h
index 21fab6ffd..300ad086b 100644
--- a/ports/stm32/mpconfigport.h
+++ b/ports/stm32/mpconfigport.h
@@ -268,11 +268,6 @@ typedef long mp_off_t;
// Configuration for shared/runtime/softtimer.c.
#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
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "mpy-stm32"
#endif
diff --git a/ports/stm32/mphalport.h b/ports/stm32/mphalport.h
index 498397087..e520bc54a 100644
--- a/ports/stm32/mphalport.h
+++ b/ports/stm32/mphalport.h
@@ -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_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.
#if __CORTEX_M == 0