Skip to content

Commit 7ecbb1b

Browse files
authored
Merge pull request #10843 from dhalbert/reset-all-pins-in-main
call reset_all_pins() in main() after port_init()
2 parents a750c5f + d2d6094 commit 7ecbb1b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,8 +1020,12 @@ int __attribute__((used)) main(void) {
10201020
// initialise the cpu and peripherals
10211021
set_safe_mode(port_init());
10221022

1023+
// All ports need pins reset, after never-reset pins are marked in port_init();
1024+
reset_all_pins();
1025+
10231026
port_heap_init();
10241027

1028+
10251029
// Turn on RX and TX LEDs if we have them.
10261030
init_rxtx_leds();
10271031

ports/atmel-samd/supervisor/port.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,9 @@ safe_mode_t port_init(void) {
339339
init_shared_dma();
340340

341341
// Reset everything into a known state before board_init.
342+
// Pins are reset in main() after this routine returns.
342343
reset_port();
343344

344-
// Reset the pins too.
345-
reset_all_pins();
346-
347345
#ifdef SAMD21
348346
if (PM->RCAUSE.bit.BOD33 == 1 || PM->RCAUSE.bit.BOD12 == 1) {
349347
return SAFE_MODE_BROWNOUT;

0 commit comments

Comments
 (0)