Skip to content

Commit

Permalink
extmod/network_cyw43: Support new cyw43-driver.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Jun 30, 2022
1 parent f75e611 commit 7dd8180
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion extmod/network_cyw43.c
Expand Up @@ -33,10 +33,15 @@
#if MICROPY_PY_NETWORK_CYW43

#include "lwip/netif.h"
#include "drivers/cyw43/cyw43.h"
#include "extmod/network_cyw43.h"
#include "modnetwork.h"

#if MICROPY_PY_NETWORK_CYW43_USE_LIB_DRIVER
#include "lib/cyw43-driver/src/cyw43.h"
#else
#include "drivers/cyw43/cyw43.h"
#endif

typedef struct _network_cyw43_obj_t {
mp_obj_base_t base;
cyw43_t *cyw;
Expand Down Expand Up @@ -119,7 +124,11 @@ STATIC mp_obj_t network_cyw43_active(size_t n_args, const mp_obj_t *args) {
if (n_args == 1) {
return mp_obj_new_bool(cyw43_tcpip_link_status(self->cyw, self->itf));
} else {
#if MICROPY_PY_NETWORK_CYW43_USE_LIB_DRIVER
cyw43_wifi_set_up(self->cyw, self->itf, mp_obj_is_true(args[1]), MICROPY_CYW43_COUNTRY);
#else
cyw43_wifi_set_up(self->cyw, self->itf, mp_obj_is_true(args[1]));
#endif
return mp_const_none;
}
}
Expand Down

0 comments on commit 7dd8180

Please sign in to comment.