Skip to content

Commit 72f5537

Browse files
committed
esp32: don't fully reset the wifi device
.. this makes reconnecting without a full reset not work. Because this works on other generations of the esp32 (c2, c3, etc), apply this behavior only to esp32. After this change, it's possible to connect multiple times to wifi in different runs of code.py or the repl after soft rebooting.
1 parent 01b18cc commit 72f5537

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ports/espressif/common-hal/wifi/__init__.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ void wifi_reset(void) {
214214
common_hal_wifi_monitor_deinit(MP_STATE_VM(wifi_monitor_singleton));
215215
wifi_radio_obj_t *radio = &common_hal_wifi_radio_obj;
216216
common_hal_wifi_radio_set_enabled(radio, false);
217+
#ifndef CONFIG_IDF_TARGET_ESP32
217218
ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT,
218219
ESP_EVENT_ANY_ID,
219220
radio->handler_instance_all_wifi));
@@ -226,6 +227,7 @@ void wifi_reset(void) {
226227
esp_netif_destroy(radio->ap_netif);
227228
radio->ap_netif = NULL;
228229
wifi_inited = false;
230+
#endif
229231
supervisor_workflow_request_background();
230232
}
231233

0 commit comments

Comments
 (0)