diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h index 6639b92413..b1a38713dc 100644 --- a/ports/stm32/mpconfigport.h +++ b/ports/stm32/mpconfigport.h @@ -253,7 +253,11 @@ extern const struct _mp_obj_type_t mp_network_cyw43_type; #endif #if MICROPY_PY_WIZNET5K +#if MICROPY_PY_LWIP +extern const struct _mp_obj_type_t mod_network_nic_type_wiznet5k; +#else extern const struct _mod_network_nic_type_t mod_network_nic_type_wiznet5k; +#endif #define MICROPY_HW_NIC_WIZNET5K { MP_ROM_QSTR(MP_QSTR_WIZNET5K), MP_ROM_PTR(&mod_network_nic_type_wiznet5k) }, #else #define MICROPY_HW_NIC_WIZNET5K diff --git a/ports/stm32/mpnetworkport.c b/ports/stm32/mpnetworkport.c index a5ee15bc67..c879c50055 100644 --- a/ports/stm32/mpnetworkport.c +++ b/ports/stm32/mpnetworkport.c @@ -48,6 +48,10 @@ // Poll lwIP every 128ms #define LWIP_TICK(tick) (((tick) & ~(SYSTICK_DISPATCH_NUM_SLOTS - 1) & 0x7f) == 0) +#if MICROPY_PY_WIZNET5K +void wiznet5k_poll(void); +#endif + u32_t sys_now(void) { return mp_hal_ticks_ms(); } diff --git a/ports/stm32/network_wiznet5k.c b/ports/stm32/network_wiznet5k.c index b6f1498eff..a529191557 100644 --- a/ports/stm32/network_wiznet5k.c +++ b/ports/stm32/network_wiznet5k.c @@ -269,7 +269,7 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, size mp_hal_pin_obj_t rst = pin_find(args[2]); // Access the existing object, if it has been constructed with the same hardware interface - if (wiznet5k_obj.base.type == &mod_network_nic_type_wiznet5k) { + if (wiznet5k_obj.base.type == (mp_obj_type_t *)&mod_network_nic_type_wiznet5k) { if (!(wiznet5k_obj.spi == spi && wiznet5k_obj.cs == cs && wiznet5k_obj.rst == rst && wiznet5k_obj.netif.flags != 0)) { wiznet5k_deinit(); @@ -277,7 +277,7 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, size } // Init the wiznet5k object - wiznet5k_obj.base.type = &mod_network_nic_type_wiznet5k; + wiznet5k_obj.base.type = (mp_obj_type_t *)&mod_network_nic_type_wiznet5k; wiznet5k_obj.cris_state = 0; wiznet5k_obj.spi = spi; wiznet5k_obj.cs = cs;