@@ -8611,10 +8611,10 @@ index af02cd193..49fd67bed 100644
86118611 extern const mp_obj_type_t machine_spi_type;
86128612diff --git a/ports/rp2/modnwwiznet5k.c b/ports/rp2/modnwwiznet5k.c
86138613new file mode 100644
8614- index 000000000..2a0e12f74
8614+ index 000000000..4ca59e838
86158615--- /dev/null
86168616+++ b/ports/rp2/modnwwiznet5k.c
8617- @@ -0,0 +1,630 @@
8617+ @@ -0,0 +1,621 @@
86188618+ /*
86198619+ * This file is part of the MicroPython project, http://micropython.org/
86208620+ *
@@ -9035,17 +9035,16 @@ index 000000000..2a0e12f74
90359035+ ctlwizchip(CW_INIT_WIZCHIP, sn_size);
90369036+
90379037+ // set some sensible default values; they are configurable using ifconfig method
9038- + /* wiz_NetInfo netinfo = {
9038+ + wiz_NetInfo netinfo = {
90399039+ .mac = {0x00, 0x08, 0xdc, 0xab, 0xcd, 0xef},
9040- + .ip = {192, 168, 0 , 18},
9040+ + .ip = {192, 168, 100 , 18},
90419041+ .sn = {255, 255, 255, 0},
9042- + .gw = {192, 168, 0 , 1},
9042+ + .gw = {192, 168, 100 , 1},
90439043+ .dns = {8, 8, 8, 8}, // Google public DNS
90449044+ .dhcp = NETINFO_STATIC,
90459045+ };
90469046+ wiznet5k_obj.netinfo = netinfo;
90479047+ ctlnetwork(CN_SET_NETINFO, (void *)&wiznet5k_obj.netinfo);
9048- + */
90499048+ // seems we need a small delay after init
90509049+ mp_hal_delay_ms(250);
90519050+
@@ -9057,20 +9056,12 @@ index 000000000..2a0e12f74
90579056+ }
90589057+ STATIC mp_obj_t wiznet5k_active(size_t n_args, const mp_obj_t *args) {
90599058+ wiznet5k_obj_t *self = MP_OBJ_TO_PTR(args[0]);
9060- + wiz_NetInfo netinfo = {
9061- + .mac = {0x00, 0x08, 0xdc, 0xab, 0xcd, 0xef},
9062- + .ip = {192, 168, 100, 18},
9063- + .sn = {255, 255, 255, 0},
9064- + .gw = {192, 168, 100, 1},
9065- + .dns = {8, 8, 8, 8}, // Google public DNS
9066- + .dhcp = NETINFO_STATIC,
9067- + };
9059+ +
90689060+ //wiz_NetInfo netinfo;
90699061+ if (n_args == 1) {
90709062+ return mp_const_none;
90719063+ } else {
90729064+ if (mp_obj_is_true(args[1])) {
9073- + self->netinfo = netinfo;
90749065+ self->netinfo.dhcp = NETINFO_DHCP;
90759066+ wiznet5k_init((void *)self);
90769067+
@@ -9084,7 +9075,7 @@ index 000000000..2a0e12f74
90849075+ printf("netif changed %d.%d.%d.%d\r\n",self->netinfo.ip[0],self->netinfo.ip[1],self->netinfo.ip[2],self->netinfo.ip[3]);
90859076+ return mp_obj_new_tuple(4, tuple);
90869077+ } else {
9087- + self->netinfo = netinfo;
9078+ + // self->netinfo = netinfo;
90889079+ self->netinfo.dhcp = NETINFO_STATIC;
90899080+
90909081+ ctlnetwork(CN_SET_NETINFO, (void *)&self->netinfo);
0 commit comments