From e9dad1fc5d673b1a260c8164d31de52d59296657 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 28 May 2020 20:05:28 +0700 Subject: [PATCH] clean up and fix typo --- changelog.md | 2 +- .../Bluefruit52Lib/src/services/BLEDfu.cpp | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/changelog.md b/changelog.md index 95abd103..e2089313 100644 --- a/changelog.md +++ b/changelog.md @@ -6,7 +6,7 @@ ## 0.20.0 - 2020.04.21 -- Fixed Wire write ambigou +- Fixed Wire write ambiguous - Improved debugging with log and sysview, thanks to @henrygab - Fixed recipe to compute SRAM and ROM of sketch - Removed the force waiting Serial when debug is enabled diff --git a/libraries/Bluefruit52Lib/src/services/BLEDfu.cpp b/libraries/Bluefruit52Lib/src/services/BLEDfu.cpp index 94d890a5..110b758b 100644 --- a/libraries/Bluefruit52Lib/src/services/BLEDfu.cpp +++ b/libraries/Bluefruit52Lib/src/services/BLEDfu.cpp @@ -164,18 +164,12 @@ static void bledfu_control_wr_authorize_cb(uint16_t conn_hdl, BLECharacteristic* VERIFY_STATUS( sd_softdevice_disable(), ); // Disable all interrupts - #if defined(NRF52832_XXAA) - #define MAX_NUMBER_INTERRUPTS 39 - #elif defined(NRF52840_XXAA) - #define MAX_NUMBER_INTERRUPTS 48 - #endif - - NVIC_ClearPendingIRQ(SD_EVT_IRQn); - for(int i=0; i < MAX_NUMBER_INTERRUPTS; i++) - { - NVIC_DisableIRQ( (IRQn_Type) i ); - } - + NVIC->ICER[0]=0xFFFFFFFF; + NVIC->ICPR[0]=0xFFFFFFFF; +#if defined(__NRF_NVIC_ISER_COUNT) && __NRF_NVIC_ISER_COUNT == 2 + NVIC->ICER[1]=0xFFFFFFFF; + NVIC->ICPR[1]=0xFFFFFFFF; +#endif // Clear RTC1 timer to prevent Interrupt happens after changing vector table // NRF_RTC1->EVTENCLR = RTC_EVTEN_COMPARE0_Msk; // NRF_RTC1->INTENCLR = RTC_INTENSET_COMPARE0_Msk;