Skip to content

Commit 6575c2c

Browse files
committed
rp2/mpconfigport.h: Disable Bluetooth locking.
* Bluetooth code runs in the scheduler, so no locking/mutex is required.
1 parent f886a4c commit 6575c2c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ports/rp2/mpconfigport.h

+6
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,12 @@ extern void mp_thread_end_atomic_section(uint32_t);
236236
#define MICROPY_PY_LWIP_REENTER lwip_lock_acquire();
237237
#define MICROPY_PY_LWIP_EXIT lwip_lock_release();
238238

239+
#if MICROPY_PY_BLUETOOTH
240+
// Bluetooth code only runs in the scheduler, no locking/mutex required.
241+
#define MICROPY_PY_BLUETOOTH_ENTER uint32_t atomic_state = 0;
242+
#define MICROPY_PY_BLUETOOTH_EXIT (void)atomic_state;
243+
#endif
244+
239245
#if MICROPY_HW_ENABLE_USBDEV
240246
#define MICROPY_HW_USBDEV_TASK_HOOK extern void usbd_task(void); usbd_task();
241247
#define MICROPY_VM_HOOK_COUNT (10)

0 commit comments

Comments
 (0)