Skip to content

Commit

Permalink
fix wifi reset and monitor deinit routine
Browse files Browse the repository at this point in the history
  • Loading branch information
microdev1 committed Nov 10, 2021
1 parent b435e7b commit a62675a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions ports/espressif/common-hal/wifi/Monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ void common_hal_wifi_monitor_construct(wifi_monitor_obj_t *self, uint8_t channel

bool common_hal_wifi_monitor_deinited(void) {
bool enabled;
esp_wifi_get_promiscuous(&enabled);
return !enabled;
return (esp_wifi_get_promiscuous(&enabled) == ESP_ERR_WIFI_NOT_INIT) ? true : !enabled;
}

void common_hal_wifi_monitor_deinit(wifi_monitor_obj_t *self) {
Expand Down
1 change: 1 addition & 0 deletions ports/espressif/common-hal/wifi/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ void wifi_reset(void) {
radio->netif = NULL;
esp_netif_destroy(radio->ap_netif);
radio->ap_netif = NULL;
wifi_inited = false;
}

void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t *esp_ip_address) {
Expand Down

0 comments on commit a62675a

Please sign in to comment.