diff options
author | Damien George <damien.p.george@gmail.com> | 2019-02-22 22:24:36 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-02-26 23:32:19 +1100 |
commit | 08a24c5f41adab401e51c3b8c4886d8fa91d256f (patch) | |
tree | 17da3db1bbbd7128f4bf15e14ef9022a002751a1 | |
parent | c55709bf29f59a3a82f33975eabf1afac153edb2 (diff) |
stm32/mpconfigport.h: Enable lwIP concurrency protection mechanism.
-rw-r--r-- | ports/stm32/mpconfigport.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h index 7ae2ac77b..712697c80 100644 --- a/ports/stm32/mpconfigport.h +++ b/ports/stm32/mpconfigport.h @@ -357,6 +357,11 @@ static inline mp_uint_t disable_irq(void) { #define MICROPY_THREAD_YIELD() #endif +// The LwIP interface must run at a raised IRQ priority +#define MICROPY_PY_LWIP_ENTER uint32_t irq_state = raise_irq_pri(IRQ_PRI_PENDSV); +#define MICROPY_PY_LWIP_REENTER irq_state = raise_irq_pri(IRQ_PRI_PENDSV); +#define MICROPY_PY_LWIP_EXIT restore_irq_pri(irq_state); + // We need an implementation of the log2 function which is not a macro #define MP_NEED_LOG2 (1) |