diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-10-22 13:48:45 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-22 13:48:45 -0700 |
| commit | c8808f41a5e45a516d3a9060b15e6a1702fc4ffb (patch) | |
| tree | 9d5c290b1eefa0a3cb30f589ba086614dfa75aa3 /ports | |
| parent | 2d2503c49df804b68aa036d5f2a89ff1df697a86 (diff) | |
| parent | e202da4dadeadfe22d30251d99c5247f024bd746 (diff) | |
Merge pull request #3580 from astrobokonon/esp32s2-FixSTAMODE
ESP32S2: Reset sta_mode and ap_mode flags
Diffstat (limited to 'ports')
| -rw-r--r-- | ports/esp32s2/common-hal/wifi/__init__.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 5c8d2e952..833ef0623 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -100,6 +100,13 @@ void common_hal_wifi_init(void) { wifi_radio_obj_t* self = &common_hal_wifi_radio_obj; self->netif = esp_netif_create_default_wifi_sta(); + // Even though we just called esp_netif_create_default_wifi_sta, + // station mode isn't actually ready for use until esp_wifi_set_mode() + // is called and the configuration is loaded via esp_wifi_set_config(). + // Set both convienence flags to false so it's not forgotten. + self->sta_mode = 0; + self->ap_mode = 0; + self->event_group_handle = xEventGroupCreateStatic(&self->event_group); ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, ESP_EVENT_ANY_ID, |
