Merge pull request #1639 from openmv/mp_deinit

ports/stm32: Call mp_deinit() before soft reboot.
This commit is contained in:
Ibrahim Abdelkader 2022-05-15 18:45:48 +02:00 committed by GitHub
commit 5de80634d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -624,12 +624,6 @@ soft_reset:
usbdbg_wait_for_command(1000); usbdbg_wait_for_command(1000);
} }
#if MICROPY_PY_LWIP
// Must call GC sweep here to close open sockets.
gc_sweep_all();
systick_disable_dispatch(SYSTICK_DISPATCH_LWIP);
#endif
// soft reset // soft reset
storage_flush(); storage_flush();
@ -639,6 +633,9 @@ soft_reset:
#if MICROPY_PY_BLUETOOTH #if MICROPY_PY_BLUETOOTH
mp_bluetooth_deinit(); mp_bluetooth_deinit();
#endif #endif
#if MICROPY_PY_LWIP
systick_disable_dispatch(SYSTICK_DISPATCH_LWIP);
#endif
mod_network_deinit(); mod_network_deinit();
timer_deinit(); timer_deinit();
i2c_deinit_all(); i2c_deinit_all();
@ -654,6 +651,10 @@ soft_reset:
py_audio_deinit(); py_audio_deinit();
#endif #endif
imlib_deinit_all(); imlib_deinit_all();
gc_sweep_all();
mp_deinit();
first_soft_reset = false; first_soft_reset = false;
goto soft_reset; goto soft_reset;
} }