File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
ports/raspberrypi/common-hal/wifi Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -75,8 +75,13 @@ bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self) {
75
75
}
76
76
77
77
void common_hal_wifi_radio_set_enabled (wifi_radio_obj_t * self , bool enabled ) {
78
- self -> enabled = enabled ;
79
78
// TODO: Actually enable and disable the WiFi module at this point.
79
+ if (self -> enabled && !enabled ) {
80
+ common_hal_wifi_radio_stop_station (self );
81
+ common_hal_wifi_radio_stop_ap (self );
82
+ }
83
+ self -> enabled = enabled ;
84
+
80
85
}
81
86
82
87
mp_obj_t common_hal_wifi_radio_get_hostname (wifi_radio_obj_t * self ) {
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ void common_hal_wifi_init(bool user_initiated) {
71
71
72
72
void wifi_user_reset (void ) {
73
73
if (wifi_user_initiated ) {
74
- // wifi_reset();
74
+ wifi_reset ();
75
75
wifi_user_initiated = false;
76
76
}
77
77
}
@@ -83,7 +83,7 @@ void wifi_reset(void) {
83
83
// the cyw43 wifi chip is not reset due to https://github.com/raspberrypi/pico-sdk/issues/980
84
84
common_hal_wifi_monitor_deinit (MP_STATE_VM (wifi_monitor_singleton ));
85
85
common_hal_wifi_radio_obj .current_scan = NULL ;
86
- // common_hal_wifi_radio_set_enabled(radio , false);
86
+ common_hal_wifi_radio_set_enabled (& common_hal_wifi_radio_obj , false);
87
87
supervisor_workflow_request_background ();
88
88
}
89
89
You can’t perform that action at this time.
0 commit comments