Skip to content

Commit a62675a

Browse files
committed
fix wifi reset and monitor deinit routine
1 parent b435e7b commit a62675a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ void common_hal_wifi_monitor_construct(wifi_monitor_obj_t *self, uint8_t channel
102102

103103
bool common_hal_wifi_monitor_deinited(void) {
104104
bool enabled;
105-
esp_wifi_get_promiscuous(&enabled);
106-
return !enabled;
105+
return (esp_wifi_get_promiscuous(&enabled) == ESP_ERR_WIFI_NOT_INIT) ? true : !enabled;
107106
}
108107

109108
void common_hal_wifi_monitor_deinit(wifi_monitor_obj_t *self) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ void wifi_reset(void) {
174174
radio->netif = NULL;
175175
esp_netif_destroy(radio->ap_netif);
176176
radio->ap_netif = NULL;
177+
wifi_inited = false;
177178
}
178179

179180
void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t *esp_ip_address) {

0 commit comments

Comments
 (0)