samd/main: Fix sercom deinit ordering in soft-reset.

If sockets were open when calling soft reset, gc_sweep_all() would try to
close them.  In case of e.g. the NINA WiFi handler, connected through SPI,
spi_transfer() would be called for command exchange with the NINA module.
But at that time SerCom was already disabled.

Moving sercom_deinit_all() behind gc_sweep_all() solves this issue.

Signed-off-by: robert-hh <robert@hammelrath.com>
This commit is contained in:
robert-hh 2023-04-07 17:34:15 +02:00 committed by Damien George
parent b7180d53f0
commit 7a847bab1e

View File

@ -84,9 +84,9 @@ void samd_main(void) {
adc_deinit_all();
pin_irq_deinit_all();
pwm_deinit_all();
sercom_deinit_all();
soft_timer_deinit();
gc_sweep_all();
sercom_deinit_all();
mp_deinit();
}
}