Skip to content

Commit 186caf9

Browse files
projectgusdpgeorge
authored andcommitted
extmod/network_cyw43: Disconnect STA if making inactive.
esp32 port will disconnect if active(0) is called on a STA interface, but rp2 port stays associated without this change. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
1 parent 9ef16b4 commit 186caf9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

extmod/network_cyw43.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ static mp_obj_t network_cyw43_active(size_t n_args, const mp_obj_t *args) {
143143
return mp_obj_new_bool(if_active[self->itf]);
144144
} else {
145145
bool value = mp_obj_is_true(args[1]);
146+
if (!value && self->itf == CYW43_ITF_STA) {
147+
cyw43_wifi_leave(self->cyw, self->itf);
148+
}
146149
cyw43_wifi_set_up(self->cyw, self->itf, value, get_country_code());
147150
if_active[self->itf] = value;
148151
return mp_const_none;

0 commit comments

Comments
 (0)