Skip to content

Commit 7a847ba

Browse files
robert-hhdpgeorge
authored andcommitted
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 <[email protected]>
1 parent b7180d5 commit 7a847ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/samd/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ void samd_main(void) {
8484
adc_deinit_all();
8585
pin_irq_deinit_all();
8686
pwm_deinit_all();
87-
sercom_deinit_all();
8887
soft_timer_deinit();
8988
gc_sweep_all();
89+
sercom_deinit_all();
9090
mp_deinit();
9191
}
9292
}

0 commit comments

Comments
 (0)