From 781ab83213ac6b35854462307947dfaad7881106 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 1 Sep 2017 11:45:31 +0700 Subject: [PATCH] clean up --- cores/nRF5/wiring.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cores/nRF5/wiring.c b/cores/nRF5/wiring.c index 85f37efd..0fa822f9 100644 --- a/cores/nRF5/wiring.c +++ b/cores/nRF5/wiring.c @@ -82,7 +82,11 @@ void waitForEvent(void) NVIC_ClearPendingIRQ(FPU_IRQn); #endif - uint8_t sd_en; +#if 1 + (void) sd_app_evt_wait(); +#else + uint8_t sd_en = 0; + (void) sd_softdevice_is_enabled(&sd_en); if ( sd_en ) @@ -95,6 +99,7 @@ void waitForEvent(void) __SEV(); // Clear Event Register. __WFE(); } +#endif } @@ -105,6 +110,14 @@ void systemOff(uint32_t pin, uint8_t wake_logic) // NRF_POWER->RAM[i].POWERCLR = 0x03UL; // } +#if 0 + // pin 0 & 1 is for XTAL + for(int i=2; iPIN_CNF[pin] |= ((uint32_t) (wake_logic ? GPIO_PIN_CNF_SENSE_High : GPIO_PIN_CNF_SENSE_Low) << GPIO_PIN_CNF_SENSE_Pos);