diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 9e36a93490d3a..d1550a386e4ee 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -32,6 +32,7 @@ CFLAGS_CYW43 := \ -DCYW43_USE_STATS=0 \ -DPICO_BUILD \ -DCYW43_ENABLE_BLUETOOTH=0 \ + -DCIRCUITPY_CYW43_INIT_DELAY=$(CIRCUITPY_CYW43_INIT_DELAY) \ -DPICO_CYW43_ARCH_POLL=0 SRC_SDK_CYW43 := \ diff --git a/ports/raspberrypi/mpconfigport.mk b/ports/raspberrypi/mpconfigport.mk index d619e78bd97a8..bb4e183461bec 100644 --- a/ports/raspberrypi/mpconfigport.mk +++ b/ports/raspberrypi/mpconfigport.mk @@ -53,6 +53,9 @@ CIRCUITPY_ALARM ?= 1 CIRCUITPY_PICODVI ?= 0 CIRCUITPY_TOUCHIO ?= 1 + +# delay in ms before calling cyw43_arch_init_with_country +CIRCUITPY_CYW43_INIT_DELAY ?= 1000 endif ifeq ($(CHIP_VARIANT),RP2350) @@ -65,6 +68,9 @@ CIRCUITPY_PICODVI ?= 1 # So, turn touchio off because it doesn't work. CIRCUITPY_TOUCHIO = 0 +# delay in ms before calling cyw43_arch_init_with_country +CIRCUITPY_CYW43_INIT_DELAY ?= 0 + # Audio effects CIRCUITPY_AUDIOEFFECTS ?= 1 endif diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c index 5d2bf4115e7ef..026d9f629c57d 100644 --- a/ports/raspberrypi/supervisor/port.c +++ b/ports/raspberrypi/supervisor/port.c @@ -361,7 +361,7 @@ safe_mode_t port_init(void) { // initializing the cyw43 chip. Delays inside cyw43_arch_init_with_country // are intended to meet the power on timing requirements, but apparently // are inadequate. We'll back off this long delay based on future testing. - mp_hal_delay_ms(1000); + mp_hal_delay_ms(CIRCUITPY_CYW43_INIT_DELAY); // Change this as a placeholder as to how to init with country code. // Default country code is CYW43_COUNTRY_WORLDWIDE)