From 794cc86989ebdfe4e75f32cddae46d0a7cb5281a Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 18 Dec 2017 22:52:46 +0700 Subject: [PATCH] fix #108 make sure all bits in OUTSET is set up on reset. --- cores/nRF5/wiring.c | 3 +++ libraries/SPI/SPI.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/cores/nRF5/wiring.c b/cores/nRF5/wiring.c index eaa1f537..5d2509df 100644 --- a/cores/nRF5/wiring.c +++ b/cores/nRF5/wiring.c @@ -54,6 +54,9 @@ void init( void ) NRF_RTC1->INTENCLR = RTC_INTENSET_COMPARE0_Msk; NRF_RTC1->TASKS_STOP = 1; NRF_RTC1->TASKS_CLEAR = 1; + + // Make sure all pin is set HIGH when pinmode() is called + NRF_GPIO->OUTSET = UINT32_MAX; } void enterSerialDfu(void) diff --git a/libraries/SPI/SPI.cpp b/libraries/SPI/SPI.cpp index fc82d73e..e0c4a2a5 100644 --- a/libraries/SPI/SPI.cpp +++ b/libraries/SPI/SPI.cpp @@ -118,6 +118,7 @@ void SPIClass::beginTransaction(SPISettings settings) void SPIClass::endTransaction(void) { + _p_spi->ENABLE = (SPI_ENABLE_ENABLE_Disabled << SPI_ENABLE_ENABLE_Pos); } void SPIClass::setBitOrder(BitOrder order)