Skip to content

Commit d45176f

Browse files
committed
ports: Move MICROPY_PY_LWIP_ENTER/REENTER/EXIT defns to mphalport.h.
Following ad806df where the MICROPY_PY_PENDSV_ENTER/REENTER/EXIT macro definitions were moved to mphalport.h. Signed-off-by: Damien George <[email protected]>
1 parent ee226a8 commit d45176f

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

Diff for: ports/mimxrt/mpconfigport.h

-5
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,6 @@ uint32_t trng_random_u32(void);
134134
#define MICROPY_PY_HASHLIB_SHA1 (MICROPY_PY_SSL)
135135
// #define MICROPY_PY_CRYPTOLIB (MICROPY_PY_SSL)
136136

137-
// Prevent the "LWIP task" from running.
138-
#define MICROPY_PY_LWIP_ENTER MICROPY_PY_PENDSV_ENTER
139-
#define MICROPY_PY_LWIP_REENTER MICROPY_PY_PENDSV_REENTER
140-
#define MICROPY_PY_LWIP_EXIT MICROPY_PY_PENDSV_EXIT
141-
142137
#ifndef MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
143138
#define MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE (1)
144139
#endif

Diff for: ports/mimxrt/mphalport.h

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
#define MICROPY_PY_PENDSV_REENTER atomic_state = raise_irq_pri(IRQ_PRI_PENDSV);
4646
#define MICROPY_PY_PENDSV_EXIT restore_irq_pri(atomic_state);
4747

48+
// Prevent the "lwIP task" from running.
49+
#define MICROPY_PY_LWIP_ENTER MICROPY_PY_PENDSV_ENTER
50+
#define MICROPY_PY_LWIP_REENTER MICROPY_PY_PENDSV_REENTER
51+
#define MICROPY_PY_LWIP_EXIT MICROPY_PY_PENDSV_EXIT
52+
4853
#define MICROPY_HW_USB_CDC_TX_TIMEOUT (500)
4954

5055
#define MP_HAL_PIN_FMT "%q"

Diff for: ports/renesas-ra/mpconfigport.h

-4
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,6 @@ typedef long mp_off_t;
292292
#define MICROPY_THREAD_YIELD()
293293
#endif
294294

295-
#define MICROPY_PY_LWIP_ENTER
296-
#define MICROPY_PY_LWIP_REENTER
297-
#define MICROPY_PY_LWIP_EXIT
298-
299295
#ifndef MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
300296
#define MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE (1)
301297
#endif

Diff for: ports/renesas-ra/mphalport.h

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
#define MICROPY_PY_PENDSV_ENTER uint32_t atomic_state = raise_irq_pri(IRQ_PRI_PENDSV)
3636
#define MICROPY_PY_PENDSV_EXIT restore_irq_pri(atomic_state)
3737

38+
#define MICROPY_PY_LWIP_ENTER
39+
#define MICROPY_PY_LWIP_REENTER
40+
#define MICROPY_PY_LWIP_EXIT
41+
3842
#define MICROPY_HW_USB_CDC_TX_TIMEOUT (500)
3943

4044
extern const unsigned char mp_hal_status_to_errno_table[4];

Diff for: ports/rp2/mpconfigport.h

-5
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,6 @@ extern const struct _mp_obj_type_t mod_network_nic_type_wiznet5k;
245245
#define MICROPY_HW_BOOTSEL_DELAY_US 8
246246
#endif
247247

248-
// Prevent the "lwIP task" from running when unsafe to do so.
249-
#define MICROPY_PY_LWIP_ENTER lwip_lock_acquire();
250-
#define MICROPY_PY_LWIP_REENTER lwip_lock_acquire();
251-
#define MICROPY_PY_LWIP_EXIT lwip_lock_release();
252-
253248
// Port level Wait-for-Event macro
254249
//
255250
// Do not use this macro directly, include py/runtime.h and

Diff for: ports/rp2/mphalport.h

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
#define MICROPY_PY_PENDSV_ENTER pendsv_suspend()
4444
#define MICROPY_PY_PENDSV_EXIT pendsv_resume()
4545

46+
// Prevent the "lwIP task" from running when unsafe to do so.
47+
#define MICROPY_PY_LWIP_ENTER lwip_lock_acquire();
48+
#define MICROPY_PY_LWIP_REENTER lwip_lock_acquire();
49+
#define MICROPY_PY_LWIP_EXIT lwip_lock_release();
50+
4651
extern int mp_interrupt_char;
4752
extern ringbuf_t stdin_ringbuf;
4853

Diff for: ports/stm32/mpconfigport.h

-5
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,6 @@ typedef long mp_off_t;
268268
// Configuration for shared/runtime/softtimer.c.
269269
#define MICROPY_SOFT_TIMER_TICKS_MS uwTick
270270

271-
// Prevent the "LWIP task" from running.
272-
#define MICROPY_PY_LWIP_ENTER MICROPY_PY_PENDSV_ENTER
273-
#define MICROPY_PY_LWIP_REENTER MICROPY_PY_PENDSV_REENTER
274-
#define MICROPY_PY_LWIP_EXIT MICROPY_PY_PENDSV_EXIT
275-
276271
#ifndef MICROPY_PY_NETWORK_HOSTNAME_DEFAULT
277272
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "mpy-stm32"
278273
#endif

Diff for: ports/stm32/mphalport.h

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ void mp_hal_set_interrupt_char(int c); // -1 to disable
5353
#define MICROPY_PY_PENDSV_REENTER atomic_state = raise_irq_pri(IRQ_PRI_PENDSV);
5454
#define MICROPY_PY_PENDSV_EXIT restore_irq_pri(atomic_state);
5555

56+
// Prevent the "lwIP task" from running.
57+
#define MICROPY_PY_LWIP_ENTER MICROPY_PY_PENDSV_ENTER
58+
#define MICROPY_PY_LWIP_REENTER MICROPY_PY_PENDSV_REENTER
59+
#define MICROPY_PY_LWIP_EXIT MICROPY_PY_PENDSV_EXIT
60+
5661
// Timing functions.
5762

5863
#if __CORTEX_M == 0

0 commit comments

Comments
 (0)