diff options
| author | Ryan T. Hamilton <astrobokonon@gmail.com> | 2020-10-20 14:49:57 -0700 |
|---|---|---|
| committer | Ryan T. Hamilton <astrobokonon@gmail.com> | 2020-10-20 14:49:57 -0700 |
| commit | c58b0adf64a99916a3b360d62dee3b2964f3876b (patch) | |
| tree | dd9587866e2a5c2d8a80fc998d938d9841b54b3a /ports | |
| parent | 1a677406bf116aaba85656c64d0632fbb60189c2 (diff) | |
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..65186e9b1 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 set 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, |
