[wifi] Restore original CYW43 STA mode setup in wifi_mode_

Restore the cyw43_wifi_set_up() call for STA mode that was incorrectly
removed. Without this, cyw43_wifi_scan() fails on initial boot because
the radio isn't initialized - scanning must work before the first
beginNoBlock() call.
This commit is contained in:
J. Nick Koston
2026-02-26 11:41:29 -10:00
parent 7e1d25859c
commit 23a2e4c92d
@@ -24,10 +24,10 @@ static bool s_sta_had_ip = false; // NOLINT(cppcoreguidelines-avoid-non-
static size_t s_scan_result_count = 0; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
bool WiFiComponent::wifi_mode_(optional<bool> sta, optional<bool> ap) {
if (sta.has_value() && sta.value()) {
// Enable STA mode so scanning works before the first beginNoBlock() call.
// Without this, cyw43_wifi_scan() fails because the radio isn't initialized.
cyw43_arch_enable_sta_mode();
if (sta.has_value()) {
if (sta.value()) {
cyw43_wifi_set_up(&cyw43_state, CYW43_ITF_STA, true, CYW43_COUNTRY_WORLDWIDE);
}
}
bool ap_state = false;