critical_section tests: do not check APP interrupts on NRF52

APP interrupts are masked on SoftDevice BLE stack only, but we
have switched to Cordio stack on NRF52 targets.
pull/10818/head
Lingkai Dong 2019-06-04 10:42:43 +01:00 committed by adbridge
parent 29446548f5
commit ad91527023
1 changed files with 3 additions and 6 deletions

View File

@ -28,12 +28,9 @@ using utest::v1::Case;
bool test_are_interrupts_enabled(void) bool test_are_interrupts_enabled(void)
{ {
// NRF5x targets don't disable interrupts when in critical section, instead they mask application interrupts this is due to BLE stack // NRF51 targets don't disable interrupts when in critical section, instead they mask application interrupts.
// (BLE to be operational requires some interrupts to be always enabled) // This is due to SoftDevice BLE stack (BLE to be operational requires some interrupts to be always enabled)
#if defined(TARGET_NRF52) #if defined(TARGET_NRF51)
// check if APP interrupts are masked for NRF52 boards
return (((NVIC->ISER[0] & __NRF_NVIC_APP_IRQS_0) != 0) || ((NVIC->ISER[1] & __NRF_NVIC_APP_IRQS_1) != 0));
#elif defined(TARGET_NRF51)
// check if APP interrupts are masked for other NRF51 boards // check if APP interrupts are masked for other NRF51 boards
return ((NVIC->ISER[0] & __NRF_NVIC_APP_IRQS_0) != 0); return ((NVIC->ISER[0] & __NRF_NVIC_APP_IRQS_0) != 0);
#else #else