Merge pull request #8371 from bill88t/rpi-auto-disconnect

`stop_station` when no wifi-reconnect
This commit is contained in:
Scott Shawcroft 2023-09-29 15:23:56 -07:00 committed by GitHub
commit d179eb4f54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -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) {
self->enabled = enabled;
// 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) {

View File

@ -71,7 +71,7 @@ void common_hal_wifi_init(bool user_initiated) {
void wifi_user_reset(void) {
if (wifi_user_initiated) {
// wifi_reset();
wifi_reset();
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
common_hal_wifi_monitor_deinit(MP_STATE_VM(wifi_monitor_singleton));
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();
}