wifi_reset
This commit is contained in:
parent
8c37156675
commit
c3cf7c0894
@ -75,8 +75,13 @@ bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) {
|
void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) {
|
||||||
self->enabled = enabled;
|
|
||||||
// TODO: Actually enable and disable the WiFi module at this point.
|
// TODO: Actually enable and disable the WiFi module at this point.
|
||||||
|
if (self->enabled && !enabled) {
|
||||||
|
common_hal_wifi_radio_stop_station(self);
|
||||||
|
common_hal_wifi_radio_stop_ap(self);
|
||||||
|
}
|
||||||
|
self->enabled = enabled;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mp_obj_t common_hal_wifi_radio_get_hostname(wifi_radio_obj_t *self) {
|
mp_obj_t common_hal_wifi_radio_get_hostname(wifi_radio_obj_t *self) {
|
||||||
|
@ -71,7 +71,7 @@ void common_hal_wifi_init(bool user_initiated) {
|
|||||||
|
|
||||||
void wifi_user_reset(void) {
|
void wifi_user_reset(void) {
|
||||||
if (wifi_user_initiated) {
|
if (wifi_user_initiated) {
|
||||||
// wifi_reset();
|
wifi_reset();
|
||||||
wifi_user_initiated = false;
|
wifi_user_initiated = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ void wifi_reset(void) {
|
|||||||
// the cyw43 wifi chip is not reset due to https://github.com/raspberrypi/pico-sdk/issues/980
|
// the cyw43 wifi chip is not reset due to https://github.com/raspberrypi/pico-sdk/issues/980
|
||||||
common_hal_wifi_monitor_deinit(MP_STATE_VM(wifi_monitor_singleton));
|
common_hal_wifi_monitor_deinit(MP_STATE_VM(wifi_monitor_singleton));
|
||||||
common_hal_wifi_radio_obj.current_scan = NULL;
|
common_hal_wifi_radio_obj.current_scan = NULL;
|
||||||
// common_hal_wifi_radio_set_enabled(radio, false);
|
common_hal_wifi_radio_set_enabled(&common_hal_wifi_radio_obj, false);
|
||||||
supervisor_workflow_request_background();
|
supervisor_workflow_request_background();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user