summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobert-hh <robert@hammelrath.com>2023-04-07 17:34:15 +0200
committerDamien George <damien@micropython.org>2023-05-22 18:37:35 +1000
commit7a847bab1e448c428ecd5d1ad1b7c66b70009587 (patch)
treec99ab6f320e3a5e9638008322c291abed15660f9
parentb7180d53f091c645a39377ddc17ee9d0bae2767f (diff)
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>
-rw-r--r--ports/samd/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/samd/main.c b/ports/samd/main.c
index bc0e45ee6..1e30df13d 100644
--- a/ports/samd/main.c
+++ b/ports/samd/main.c
@@ -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();
}
}