Skip to content

Commit 345f1d2

Browse files
iabdalkaderdpgeorge
authored andcommitted
rp2/cyw43_configport: Make sure only core0 executes a __WFI().
This commit executes __WFI() on core 0 only to avoid core1 locking up since it doesn't enable any interrupts by default (except for `SIO_IRQ_PROC1`). This fixes a lockup when calling `cyw43_do_ioctl` from core1. Fixes issue adafruit#9597.
1 parent d68e3b0 commit 345f1d2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ports/rp2/cyw43_configport.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,15 @@
4747
#define CYW43_THREAD_EXIT MICROPY_PY_LWIP_EXIT
4848
#define CYW43_THREAD_LOCK_CHECK
4949

50-
#define CYW43_SDPCM_SEND_COMMON_WAIT __WFI();
51-
#define CYW43_DO_IOCTL_WAIT __WFI();
50+
#define CYW43_SDPCM_SEND_COMMON_WAIT \
51+
if (get_core_num() == 0) { \
52+
__WFI(); \
53+
} \
54+
55+
#define CYW43_DO_IOCTL_WAIT \
56+
if (get_core_num() == 0) { \
57+
__WFI(); \
58+
} \
5259

5360
#define CYW43_ARRAY_SIZE(a) MP_ARRAY_SIZE(a)
5461

0 commit comments

Comments
 (0)