Fix CYW43/LWIP and soft-reset bugs.
@@ -523,8 +523,8 @@ soft_reset:
#if LWIP_MDNS_RESPONDER
mdns_resp_init();
#endif
- systick_enable_dispatch(SYSTICK_DISPATCH_LWIP, mod_network_lwip_poll_wrapper);
}
+ systick_enable_dispatch(SYSTICK_DISPATCH_LWIP, mod_network_lwip_poll_wrapper);
#endif
#if MICROPY_PY_NETWORK_CYW43
@@ -722,6 +722,12 @@ soft_reset:
}
} while (openmv_config.wifidbg == true);
+ #if MICROPY_PY_LWIP
+ // Must call GC sweep here to close open sockets.
+ gc_sweep_all();
+ systick_disable_dispatch(SYSTICK_DISPATCH_LWIP);
+ #endif
+
// Disable all other IRQs except Systick and Flash IRQs
// Note: FS IRQ is disable, since we're going for a soft-reset.
irq_set_base_priority(IRQ_PRI_FLASH+1);
@@ -745,9 +751,6 @@ soft_reset:
#ifdef IMLIB_ENABLE_DMA2D
imlib_draw_row_deinit_all();
#endif
- #if MICROPY_PY_LWIP
- gc_sweep_all();
- #endif
first_soft_reset = false;
goto soft_reset;
}
