Merge pull request #114 from adafruit/pin_reset

Make sure all pins are in reset state on teardown
This commit is contained in:
Ha Thach 2020-03-12 11:41:06 +07:00 committed by GitHub
commit 8ccb638a84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -115,6 +115,15 @@ void board_teardown(void)
// Stop LF clock
NRF_CLOCK->TASKS_LFCLKSTOP = 1UL;
// make sure all pins are back in reset state
for (int i = 0; i < 32; ++i)
{
NRF_P0->PIN_CNF[i] = 2;
#ifdef NRF_P1
NRF_P1->PIN_CNF[i] = 2;
#endif
}
}
static uint32_t _systick_count = 0;