summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--extmod/modbluetooth.c1
-rw-r--r--ports/stm32/mpconfigport.h4
2 files changed, 5 insertions, 0 deletions
diff --git a/extmod/modbluetooth.c b/extmod/modbluetooth.c
index 96cd41ae45..2293e03673 100644
--- a/extmod/modbluetooth.c
+++ b/extmod/modbluetooth.c
@@ -33,6 +33,7 @@
#include "py/objarray.h"
#include "py/qstr.h"
#include "py/runtime.h"
+#include "py/mphal.h"
#include "extmod/modbluetooth.h"
#include <string.h>
diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h
index fc54026f6b..becde2b919 100644
--- a/ports/stm32/mpconfigport.h
+++ b/ports/stm32/mpconfigport.h
@@ -366,6 +366,10 @@ static inline mp_uint_t disable_irq(void) {
#define MICROPY_PY_LWIP_REENTER irq_state = raise_irq_pri(IRQ_PRI_PENDSV);
#define MICROPY_PY_LWIP_EXIT restore_irq_pri(irq_state);
+// Bluetooth calls must run at a raised IRQ priority
+#define MICROPY_PY_BLUETOOTH_ENTER MICROPY_PY_LWIP_ENTER
+#define MICROPY_PY_BLUETOOTH_EXIT MICROPY_PY_LWIP_EXIT
+
// We need an implementation of the log2 function which is not a macro
#define MP_NEED_LOG2 (1)