Skip to content

Commit 8ccb638

Browse files
authored
Merge pull request #114 from adafruit/pin_reset
Make sure all pins are in reset state on teardown
2 parents e2e220a + fc63d50 commit 8ccb638

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/boards.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ void board_teardown(void)
115115

116116
// Stop LF clock
117117
NRF_CLOCK->TASKS_LFCLKSTOP = 1UL;
118+
119+
// make sure all pins are back in reset state
120+
for (int i = 0; i < 32; ++i)
121+
{
122+
NRF_P0->PIN_CNF[i] = 2;
123+
#ifdef NRF_P1
124+
NRF_P1->PIN_CNF[i] = 2;
125+
#endif
126+
}
118127
}
119128

120129
static uint32_t _systick_count = 0;

0 commit comments

Comments
 (0)