File tree Expand file tree Collapse file tree
ports/raspberrypi/common-hal/wifi Expand file tree Collapse file tree 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) {
7575}
7676
7777void common_hal_wifi_radio_set_enabled (wifi_radio_obj_t * self , bool enabled ) {
78- self -> enabled = enabled ;
7978 // 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+
8085}
8186
8287mp_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) {
7171
7272void wifi_user_reset (void ) {
7373 if (wifi_user_initiated ) {
74- // wifi_reset();
74+ wifi_reset ();
7575 wifi_user_initiated = false;
7676 }
7777}
@@ -83,7 +83,7 @@ void wifi_reset(void) {
8383 // the cyw43 wifi chip is not reset due to https://github.com/raspberrypi/pico-sdk/issues/980
8484 common_hal_wifi_monitor_deinit (MP_STATE_VM (wifi_monitor_singleton ));
8585 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);
8787 supervisor_workflow_request_background ();
8888}
8989
You can’t perform that action at this time.
0 commit comments