From 6478ca17bef998dd6c3d0e61d384f60649d1a463 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 18 Dec 2017 22:57:05 +0700 Subject: [PATCH] fix #108 make sure all bits in OUTSET is set HIGH when 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 02d84afd..a972fa47 100644 --- a/cores/nRF5/wiring.c +++ b/cores/nRF5/wiring.c @@ -56,6 +56,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)