Skip to content

Commit 67cf005

Browse files
committed
nrf: nvm: assume sd is not enabled if interrupts are off
If interrupts are disabled, then calling sd_* functions will hardfault. Instead, assume that it's safe to write if interrupts are disabled. Signed-off-by: Sean Cross <sean@xobs.io>
1 parent fd4ef23 commit 67cf005

File tree

1 file changed

+2
-0
lines changed
  • ports/nrf/peripherals/nrf

1 file changed

+2
-0
lines changed

ports/nrf/peripherals/nrf/nvm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040

4141
STATIC bool sd_is_enabled(void) {
4242
uint8_t sd_en = 0;
43+
if (__get_PRIMASK())
44+
return false;
4345
(void) sd_softdevice_is_enabled(&sd_en);
4446
return sd_en;
4547
}

0 commit comments

Comments
 (0)