Thanks to visit codestin.com
Credit goes to github.com

Skip to content

move cyw43 init after safe mode check #7303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions ports/raspberrypi/supervisor/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,6 @@ safe_mode_t port_init(void) {
never_reset_pin_number(24);
never_reset_pin_number(25);
never_reset_pin_number(29);
// Change this as a placeholder as to how to init with country code.
// Default country code is CYW43_COUNTRY_WORLDWIDE)
if (cyw43_arch_init_with_country(PICO_CYW43_ARCH_DEFAULT_COUNTRY_CODE)) {
serial_write("WiFi init failed\n");
} else {
cyw_ever_init = true;
}
#endif
if (board_requests_safe_mode()) {
return USER_SAFE_MODE;
Expand All @@ -159,6 +152,18 @@ safe_mode_t port_init(void) {
}

void reset_port(void) {
#if CIRCUITPY_CYW43
if (!cyw_ever_init) {
// Change this as a placeholder as to how to init with country code.
// Default country code is CYW43_COUNTRY_WORLDWIDE)
if (cyw43_arch_init_with_country(PICO_CYW43_ARCH_DEFAULT_COUNTRY_CODE)) {
serial_write("WiFi init failed\n");
} else {
cyw_ever_init = true;
}
}
#endif

#if CIRCUITPY_BUSIO
reset_i2c();
reset_spi();
Expand Down